You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(43) |
Nov
(4) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(97) |
Mar
(29) |
Apr
(2) |
May
(22) |
Jun
(38) |
Jul
(11) |
Aug
(27) |
Sep
(40) |
Oct
(2) |
Nov
(17) |
Dec
(8) |
2002 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(480) |
May
(456) |
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(18) |
Nov
(3) |
Dec
(6) |
2003 |
Jan
|
Feb
(18) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(147) |
Jul
(7) |
Aug
(3) |
Sep
(235) |
Oct
(10) |
Nov
(2) |
Dec
(1) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Andy P. <at...@us...> - 2002-04-10 18:30:57
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips64/mips-boards/malta In directory usw-pr-cvs1:/tmp/cvs-serv18937/mips64/mips-boards/malta Added Files: Makefile malta_int.c malta_rtc.c malta_setup.c Log Message: synch 2.4.15 commit 38 --- NEW FILE --- # # Carsten Langgaard, car...@mi... # Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. # # ######################################################################## # # This program is free software; you can distribute it and/or modify it # under the terms of the GNU General Public License (Version 2) as # published by the Free Software Foundation. # # This program is distributed in the hope it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. # # ####################################################################### # # Makefile for the MIPS Malta specific kernel interface routines # under Linux. # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # # Note 2! The CFLAGS definitions are now in the main makefile... .S.s: $(CPP) $(CFLAGS) $< -o $*.s .S.o: $(CC) $(CFLAGS) -c $< -o $*.o all: malta.o O_TARGET := malta.o obj-y := malta_int.o malta_rtc.o malta_setup.o include $(TOPDIR)/Rules.make --- NEW FILE --- /* * Carsten Langgaard, car...@mi... * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. * * ######################################################################## * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * ######################################################################## * * Routines for generic manipulation of the interrupts found on the MIPS * Malta board. * The interrupt controller is located in the South Bridge a PIIX4 device * with two internal 82C95 interrupt controllers. * */ #include <linux/config.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/interrupt.h> #include <linux/kernel_stat.h> #include <linux/random.h> #include <asm/irq.h> #include <asm/io.h> #include <asm/mips-boards/malta.h> #include <asm/mips-boards/maltaint.h> #include <asm/mips-boards/piix4.h> #include <asm/mips-boards/gt64120.h> #include <asm/mips-boards/generic.h> extern asmlinkage void mipsIRQ(void); unsigned int local_bh_count[NR_CPUS]; unsigned int local_irq_count[NR_CPUS]; unsigned long spurious_count = 0; static struct irqaction *hw0_irq_action[MALTAINT_END] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static struct irqaction r4ktimer_action = { NULL, 0, 0, "R4000 timer/counter", NULL, NULL, }; static struct irqaction *irq_action[8] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, &r4ktimer_action }; #if 0 #define DEBUG_INT(x...) printk(x) #else #define DEBUG_INT(x...) #endif /* * This contains the interrupt mask for both 82C59 interrupt controllers. */ static unsigned int cached_int_mask = 0xffff; void disable_irq(unsigned int irq_nr) { unsigned long flags; if(irq_nr >= MALTAINT_END) { printk("whee, invalid irq_nr %d\n", irq_nr); panic("IRQ, you lose..."); } save_and_cli(flags); cached_int_mask |= (1 << irq_nr); if (irq_nr & 8) { outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1); } else { outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1); } restore_flags(flags); } void enable_irq(unsigned int irq_nr) { unsigned long flags; if(irq_nr >= MALTAINT_END) { printk("whee, invalid irq_nr %d\n", irq_nr); panic("IRQ, you lose..."); } save_and_cli(flags); cached_int_mask &= ~(1 << irq_nr); if (irq_nr & 8) { outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1); /* Enable irq 2 (cascade interrupt). */ cached_int_mask &= ~(1 << 2); outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1); } else { outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1); } restore_flags(flags); } int get_irq_list(char *buf) { int i, len = 0; int num = 0; struct irqaction *action; for (i = 0; i < 8; i++, num++) { action = irq_action[i]; if (!action) continue; len += sprintf(buf+len, "%2d: %8d %c %s", num, kstat.irqs[0][num], (action->flags & SA_INTERRUPT) ? '+' : ' ', action->name); for (action=action->next; action; action = action->next) { len += sprintf(buf+len, ",%s %s", (action->flags & SA_INTERRUPT) ? " +" : "", action->name); } len += sprintf(buf+len, " [on-chip]\n"); } for (i = 0; i < MALTAINT_END; i++, num++) { action = hw0_irq_action[i]; if (!action) continue; len += sprintf(buf+len, "%2d: %8d %c %s", num, kstat.irqs[0][num], (action->flags & SA_INTERRUPT) ? '+' : ' ', action->name); for (action=action->next; action; action = action->next) { len += sprintf(buf+len, ",%s %s", (action->flags & SA_INTERRUPT) ? " +" : "", action->name); } len += sprintf(buf+len, " [hw0]\n"); } return len; } int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, void *dev_id) { struct irqaction *action; int retval; DEBUG_INT("request_irq: irq=%d, devname = %s\n", irq, devname); if (irq >= MALTAINT_END) return -EINVAL; if (!handler) return -EINVAL; action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL); if(!action) return -ENOMEM; action->handler = handler; action->flags = irqflags; action->mask = 0; action->name = devname; action->dev_id = dev_id; action->next = 0; retval = setup_irq(irq, action); if (retval) kfree(action); return retval; } void free_irq(unsigned int irq, void *dev_id) { struct irqaction *action, **p; if (irq >= MALTAINT_END) { printk("Trying to free IRQ%d\n",irq); return; } for (p = &hw0_irq_action[irq]; (action = *p) != NULL; p = &action->next) { if (action->dev_id != dev_id) continue; /* Found it - now free it */ *p = action->next; kfree(action); if (!hw0_irq_action[irq]) disable_irq(irq); return; } printk("Trying to free IRQ%d\n",irq); } void __init init_IRQ(void) { irq_setup(); } static int setup_irq(unsigned int irq, struct irqaction * new) { int shared = 0; struct irqaction *old, **p; p = &hw0_irq_action[irq]; if ((old = *p) != NULL) { /* Can't share interrupts unless both agree to */ if (!(old->flags & new->flags & SA_SHIRQ)) return -EBUSY; /* Can't share interrupts unless both are same type */ if ((old->flags ^ new->flags) & SA_INTERRUPT) return -EBUSY; /* add new interrupt at end of irq queue */ do { p = &old->next; old = *p; } while (old); shared = 1; } if (new->flags & SA_SAMPLE_RANDOM) rand_initialize_irq(irq); *p = new; if (!shared) enable_irq(irq); return 0; } static inline int get_int(int *irq) { /* * Determine highest priority pending interrupt by performing * a PCI Interrupt Acknowledge cycle. */ GT_READ(GT_PCI0_IACK_OFS, *irq); *irq &= 0xFF; /* * IRQ7 is used to detect spurious interrupts. * The interrupt acknowledge cycle returns IRQ7, if no * interrupts is requested. * We can differentiate between this situation and a * "Normal" IRQ7 by reading the ISR. */ if (*irq == 7) { outb(PIIX4_OCW3_SEL | PIIX4_OCW3_ISR, PIIX4_ICTLR1_OCW3); if (!(inb(PIIX4_ICTLR1_OCW3) & (1 << 7))) return -1; /* Spurious interrupt. */ } return 0; } static inline void ack_int(int irq) { if (irq & 8) { /* Specific EOI to cascade */ outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI | PIIX4_OCW2_ILS_2, PIIX4_ICTLR1_OCW2); /* Non specific EOI to cascade */ outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI, PIIX4_ICTLR2_OCW2); } else { /* Non specific EOI to cascade */ outb(PIIX4_OCW2_SEL | PIIX4_OCW2_NSEOI, PIIX4_ICTLR1_OCW2); } } void malta_hw0_irqdispatch(struct pt_regs *regs) { struct irqaction *action; int irq=0, cpu = smp_processor_id(); DEBUG_INT("malta_hw0_irqdispatch\n"); if (get_int(&irq)) return; /* interrupt has already been cleared */ disable_irq(irq); ack_int(irq); DEBUG_INT("malta_hw0_irqdispatch: irq=%d\n", irq); action = hw0_irq_action[irq]; /* * if action == NULL, then we don't have a handler * for the irq */ if ( action == NULL ) return; irq_enter(cpu, irq); kstat.irqs[0][irq + 8]++; do { action->handler(irq, action->dev_id, regs); action = action->next; } while (action); enable_irq(irq); irq_exit(cpu, irq); } unsigned long probe_irq_on (void) { unsigned int i, irqs = 0; unsigned long delay; /* first, enable any unassigned irqs */ for (i = MALTAINT_END-1; i > 0; i--) { if (!hw0_irq_action[i]) { enable_irq(i); irqs |= (1 << i); } } /* wait for spurious interrupts to mask themselves out again */ for (delay = jiffies + HZ/10; time_before(jiffies, delay); ) /* about 100ms delay */; /* now filter out any obviously spurious interrupts */ return irqs & ~cached_int_mask; } int probe_irq_off (unsigned long irqs) { unsigned int i; irqs &= cached_int_mask; if (!irqs) return 0; i = ffz(~irqs); if (irqs != (irqs & (1 << i))) i = -i; return i; } void __init maltaint_init(void) { /* * Mask out all interrupt by writing "1" to all bit position in * the IMR register. */ outb(cached_int_mask & 0xff, PIIX4_ICTLR1_OCW1); outb((cached_int_mask >> 8) & 0xff, PIIX4_ICTLR2_OCW1); /* Now safe to set the exception vector. */ set_except_vector(0, mipsIRQ); } --- NEW FILE --- /* * Carsten Langgaard, car...@mi... * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. * * ######################################################################## * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * ######################################################################## * * RTC routines for Malta style attached PIIX4 device, which contains a * Motorola MC146818A-compatible Real Time Clock. * */ #include <asm/mc146818rtc.h> #include <asm/mips-boards/malta.h> static unsigned char malta_rtc_read_data(unsigned long addr) { outb(addr, MALTA_RTC_ADR_REG); return inb(MALTA_RTC_DAT_REG); } static void malta_rtc_write_data(unsigned char data, unsigned long addr) { outb(addr, MALTA_RTC_ADR_REG); outb(data, MALTA_RTC_DAT_REG); } static int malta_rtc_bcd_mode(void) { return 0; } struct rtc_ops malta_rtc_ops = { &malta_rtc_read_data, &malta_rtc_write_data, &malta_rtc_bcd_mode }; --- NEW FILE --- /* * Carsten Langgaard, car...@mi... * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. * * ######################################################################## * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * ######################################################################## * * Malta specific setup, including init of the feature struct. * */ #include <linux/config.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/mc146818rtc.h> #include <linux/ioport.h> #include <linux/pci.h> #ifdef CONFIG_BLK_DEV_IDE #include <linux/ide.h> #endif #include <asm/cpu.h> #include <asm/bootinfo.h> #include <asm/irq.h> #include <asm/mips-boards/generic.h> #include <asm/mips-boards/prom.h> #include <asm/mips-boards/gt64120.h> #include <asm/mips-boards/malta.h> #include <asm/mips-boards/maltaint.h> #ifdef CONFIG_BLK_DEV_FD #include <asm/floppy.h> #endif #include <asm/dma.h> #include <asm/mmu_context.h> #if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_PROM_CONSOLE) extern void console_setup(char *, int *); char serial_console[20]; #endif #ifdef CONFIG_REMOTE_DEBUG extern void set_debug_traps(void); extern void rs_kgdb_hook(int); extern void breakpoint(void); static int remote_debug = 0; #endif #ifdef CONFIG_BLK_DEV_IDE extern struct ide_ops std_ide_ops; #endif #ifdef CONFIG_BLK_DEV_FD extern struct fd_ops std_fd_ops; #endif extern struct rtc_ops malta_rtc_ops; extern void mips_reboot_setup(void); struct resource standard_io_resources[] = { { "dma1", 0x00, 0x1f, IORESOURCE_BUSY }, { "pic1", 0x20, 0x3f, IORESOURCE_BUSY }, { "timer", 0x40, 0x5f, IORESOURCE_BUSY }, { "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY }, { "pic2", 0xa0, 0xbf, IORESOURCE_BUSY }, { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY }, }; #define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource)) static void __init malta_irq_setup(void) { maltaint_init(); #ifdef CONFIG_REMOTE_DEBUG if (remote_debug) { set_debug_traps(); breakpoint(); } #endif } void __init malta_setup(void) { #ifdef CONFIG_REMOTE_DEBUG int rs_putDebugChar(char); char rs_getDebugChar(void); extern int (*putDebugChar)(char); extern char (*getDebugChar)(void); #endif char *argptr; int i; current_cpu_data.asid_cache = ASID_FIRST_VERSION; TLBMISS_HANDLER_SETUP(); irq_setup = malta_irq_setup; /* Request I/O space for devices used on the Malta board. */ for (i = 0; i < STANDARD_IO_RESOURCES; i++) request_resource(&ioport_resource, standard_io_resources+i); /* * Enable DMA channel 4 (cascade channel) in the PIIX4 south bridge. */ enable_dma(4); #ifdef CONFIG_SERIAL_CONSOLE argptr = prom_getcmdline(); if ((argptr = strstr(argptr, "console=ttyS0")) == NULL) { int i=0; char *s = prom_getenv("modetty0"); while(s[i] >= '0' && s[i] <= '9') i++; strcpy(serial_console, "ttyS0,"); strncpy(serial_console + 6, s, i); prom_printf("Config serial console: %s\n", serial_console); console_setup(serial_console, NULL); } #endif #ifdef CONFIG_REMOTE_DEBUG argptr = prom_getcmdline(); if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) { int line; argptr += strlen("kgdb=ttyS"); if (*argptr != '0' && *argptr != '1') printk("KGDB: Uknown serial line /dev/ttyS%c, " "falling back to /dev/ttyS1\n", *argptr); line = *argptr == '0' ? 0 : 1; printk("KGDB: Using serial line /dev/ttyS%d for session\n", line ? 1 : 0); rs_kgdb_hook(line); putDebugChar = rs_putDebugChar; getDebugChar = rs_getDebugChar; prom_printf("KGDB: Using serial line /dev/ttyS%d for session, " "please connect your debugger\n", line ? 1 : 0); remote_debug = 1; /* Breakpoints and stuff are in malta_irq_setup() */ } #endif argptr = prom_getcmdline(); if ((argptr = strstr(argptr, "nofpu")) != NULL) mips_cpu.options &= ~MIPS_CPU_FPU; rtc_ops = &malta_rtc_ops; #ifdef CONFIG_BLK_DEV_IDE ide_ops = &std_ide_ops; #endif #ifdef CONFIG_BLK_DEV_FD fd_ops = &std_fd_ops; #endif } |
From: Andy P. <at...@us...> - 2002-04-10 18:30:55
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/mips/ddb5xxx/common In directory usw-pr-cvs1:/tmp/cvs-serv20728/mips/ddb5xxx/common Added Files: Makefile irq.c irq_cpu.c nile4.c pci.c pci_auto.c prom.c rtc_ds1386.c Log Message: synch 2.4.15 commit 39 --- NEW FILE --- # # Makefile for the common code of NEC DDB-Vrc5xxx board # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # .S.s: $(CPP) $(CFLAGS) $< -o $*.s .S.o: $(CC) $(CFLAGS) -c $< -o $*.o O_TARGET:= ddb5xxx.o obj-y += irq.o irq_cpu.o nile4.o prom.o pci.o pci_auto.o rtc_ds1386.o include $(TOPDIR)/Rules.make --- NEW FILE --- /* * Copyright 2001 MontaVista Software Inc. * Author: js...@mv... or js...@ju... * * arch/mips/ddb5xxx/common/irq.c * Common irq code for DDB boards. This really should belong * arch/mips/kernel/irq.c. Need to talk to Ralf. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include <linux/config.h> #include <linux/init.h> void (*irq_setup)(void); void __init init_IRQ(void) { #ifdef CONFIG_REMOTE_DEBUG extern void breakpoint(void); extern void set_debug_traps(void); printk("Wait for gdb client connection ...\n"); set_debug_traps(); breakpoint(); #endif /* invoke board-specific irq setup */ irq_setup(); } --- NEW FILE --- /*********************************************************************** * Copyright 2001 MontaVista Software Inc. * Author: Jun Sun, js...@mv... or js...@ju... * * arch/mips/ddb5xxx/common/irq_cpu.c * This file define the irq handler for MIPS CPU interrupts. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. *********************************************************************** */ /* * Almost all MIPS CPUs define 8 interrupt sources. They are typically * level triggered (i.e., cannot be cleared from CPU; must be cleared from * device). The first two are software interrupts. The last one is * usually cpu timer interrupt if coutner register is present. * * This file exports one global function: * mips_cpu_irq_init(u32 irq_base); */ #include <linux/irq.h> #include <linux/types.h> #include <linux/kernel.h> #include <asm/mipsregs.h> /* [jsun] sooner or later we should move this debug stuff to MIPS common */ #include <asm/ddb5xxx/debug.h> static int mips_cpu_irq_base=-1; static void mips_cpu_irq_enable(unsigned int irq) { MIPS_ASSERT(mips_cpu_irq_base != -1); MIPS_ASSERT(irq >= mips_cpu_irq_base); MIPS_ASSERT(irq < mips_cpu_irq_base+8); clear_cp0_cause( 1 << (irq - mips_cpu_irq_base + 8)); set_cp0_status(1 << (irq - mips_cpu_irq_base + 8)); } static void mips_cpu_irq_disable(unsigned int irq) { MIPS_ASSERT(mips_cpu_irq_base != -1); MIPS_ASSERT(irq >= mips_cpu_irq_base); MIPS_ASSERT(irq < mips_cpu_irq_base+8); clear_cp0_status(1 << (irq - mips_cpu_irq_base + 8)); } static unsigned int mips_cpu_irq_startup(unsigned int irq) { mips_cpu_irq_enable(irq); return 0; } #define mips_cpu_irq_shutdown mips_cpu_irq_disable static void mips_cpu_irq_ack(unsigned int irq) { MIPS_ASSERT(mips_cpu_irq_base != -1); MIPS_ASSERT(irq >= mips_cpu_irq_base); MIPS_ASSERT(irq < mips_cpu_irq_base+8); /* although we attemp to clear the IP bit in cause reigster, I think * usually it is cleared by device (irq source) */ clear_cp0_cause( 1 << (irq - mips_cpu_irq_base + 8)); /* I am not fully convinced that I should disable irq here */ } static void mips_cpu_irq_end(unsigned int irq) { MIPS_ASSERT(mips_cpu_irq_base != -1); MIPS_ASSERT(irq >= mips_cpu_irq_base); MIPS_ASSERT(irq < mips_cpu_irq_base+8); /* I am not fully convinced that I should enable irq here */ } static hw_irq_controller mips_cpu_irq_controller = { "CPU_irq", mips_cpu_irq_startup, mips_cpu_irq_shutdown, mips_cpu_irq_enable, mips_cpu_irq_disable, mips_cpu_irq_ack, mips_cpu_irq_end, NULL /* no affinity stuff for UP */ }; void mips_cpu_irq_init(u32 irq_base) { extern irq_desc_t irq_desc[]; u32 i; for (i= irq_base; i< irq_base+8; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = NULL; irq_desc[i].depth = 1; irq_desc[i].handler = &mips_cpu_irq_controller; } mips_cpu_irq_base = irq_base; } --- NEW FILE --- /*********************************************************************** * * Copyright 2001 MontaVista Software Inc. * Author: js...@mv... or js...@ju... * * arch/mips/ddb5xxx/common/nile4.c * misc low-level routines for vrc-5xxx controllers. * * derived from original code by Geert Uytterhoeven <ge...@so...> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * *********************************************************************** */ #include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <asm/ddb5xxx/ddb5xxx.h> #include <asm/ddb5xxx/debug.h> u32 ddb_calc_pdar(u32 phys, u32 size, int width, int on_memory_bus, int pci_visible) { u32 maskbits; u32 widthbits; switch (size) { #if 0 /* We don't support 4 GB yet */ case 0x100000000: /* 4 GB */ maskbits = 4; break; #endif case 0x80000000: /* 2 GB */ maskbits = 5; break; case 0x40000000: /* 1 GB */ maskbits = 6; break; case 0x20000000: /* 512 MB */ maskbits = 7; break; case 0x10000000: /* 256 MB */ maskbits = 8; break; case 0x08000000: /* 128 MB */ maskbits = 9; break; case 0x04000000: /* 64 MB */ maskbits = 10; break; case 0x02000000: /* 32 MB */ maskbits = 11; break; case 0x01000000: /* 16 MB */ maskbits = 12; break; case 0x00800000: /* 8 MB */ maskbits = 13; break; case 0x00400000: /* 4 MB */ maskbits = 14; break; case 0x00200000: /* 2 MB */ maskbits = 15; break; case 0: /* OFF */ maskbits = 0; break; default: panic("nile4_set_pdar: unsupported size %p\n", (void *) size); } switch (width) { case 8: widthbits = 0; break; case 16: widthbits = 1; break; case 32: widthbits = 2; break; case 64: widthbits = 3; break; default: panic("nile4_set_pdar: unsupported width %d\n", width); } return maskbits | (on_memory_bus ? 0x10 : 0) | (pci_visible ? 0x20 : 0) | (widthbits << 6) | (phys & 0xffe00000); } void ddb_set_pdar(u32 pdar, u32 phys, u32 size, int width, int on_memory_bus, int pci_visible) { u32 temp= ddb_calc_pdar(phys, size, width, on_memory_bus, pci_visible); ddb_out32(pdar, temp); ddb_out32(pdar + 4, 0); /* * When programming a PDAR, the register should be read immediately * after writing it. This ensures that address decoders are properly * configured. * [jsun] is this really necesary? */ ddb_in32(pdar); ddb_in32(pdar + 4); } /* * routines that mess with PCIINITx registers */ void ddb_set_pmr(u32 pmr, u32 type, u32 addr, u32 options) { switch (type) { case DDB_PCICMD_IACK: /* PCI Interrupt Acknowledge */ case DDB_PCICMD_IO: /* PCI I/O Space */ case DDB_PCICMD_MEM: /* PCI Memory Space */ case DDB_PCICMD_CFG: /* PCI Configuration Space */ break; default: panic("nile4_set_pmr: invalid type %d\n", type); } ddb_out32(pmr, (type << 1) | (addr & 0xffe00000) | options ); ddb_out32(pmr + 4, 0); } --- NEW FILE --- /*********************************************************************** * Copyright 2001 MontaVista Software Inc. * Author: Jun Sun, js...@mv... or js...@ju... * * arch/mips/ddb5xxx/common/pci.c * Common PCI routines for DDB5xxx - as a matter of fact, meant for all * MIPS machines. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. *********************************************************************** */ /* * This file contains common PCI routines meant to be shared for * all MIPS machines. * * Strategies: * * . We rely on pci_auto.c file to assign PCI resources (MEM and IO) * TODO: this shold be optional for some machines where they do have * a real "pcibios" that does resource assignment. * * . We then use pci_scan_bus() to "discover" all the resources for * later use by Linux. * * . We finally reply on a board supplied function, pcibios_fixup_irq(), to * to assign the interrupts. We may use setup-irq.c under drivers/pci * later. * * . Specifically, we will *NOT* use pci_assign_unassigned_resources(), * because we assume all PCI devices should have the resources correctly * assigned and recorded. * * Limitations: * * . We "collapse" all IO and MEM spaces in sub-buses under a top-level bus * into a contiguous range. * * . In the case of Memory space, the rnage is 1:1 mapping with CPU physical * address space. * * . In the case of IO space, it starts from 0, and the beginning address * is mapped to KSEG0ADDR(mips_io_port) in the CPU physical address. * * . These are the current MIPS limitations (by ioremap, etc). In the * future, we may remove them. * * Credits: * Most of the code are derived from the pci routines from PPC and Alpha, * which were mostly writtne by * Cort Dougan, co...@fs... * Matt Porter, mp...@mv... * Dave Rusling dav...@re... * David Mosberger da...@cs... */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/types.h> #include <linux/pci.h> #include <asm/ddb5xxx/pci.h> #include <asm/ddb5xxx/debug.h> struct pci_fixup pcibios_fixups[] = { {0} }; extern int pciauto_assign_resources(int busno, struct pci_channel * hose); void __init pcibios_init(void) { struct pci_channel *p; struct pci_bus *bus; int busno; /* assign resources */ busno=0; for (p= mips_pci_channels; p->pci_ops != NULL; p++) { busno = pciauto_assign_resources(busno, p) + 1; } /* scan the buses */ busno = 0; for (p= mips_pci_channels; p->pci_ops != NULL; p++) { bus = pci_scan_bus(busno, p->pci_ops, p); busno = bus->subordinate+1; } /* fixup irqs (board specific routines) */ pcibios_fixup_irqs(); /* * should we do a fixup of ioport_resource and iomem_resource * based on mips_pci_channels? * Let us wait and see if this is a common need and whether there * are exceptions. Until then, each board should adjust them * perhaps in their setup() function. */ } int pcibios_enable_device(struct pci_dev *dev) { /* pciauto_assign_resources() will enable all devices found */ return 0; } unsigned long __init pci_bridge_check_io(struct pci_dev *bridge) { u16 io; pci_read_config_word(bridge, PCI_IO_BASE, &io); if (!io) { pci_write_config_word(bridge, PCI_IO_BASE, 0xf0f0); pci_read_config_word(bridge, PCI_IO_BASE, &io); pci_write_config_word(bridge, PCI_IO_BASE, 0x0); } if (io) return IORESOURCE_IO; printk(KERN_WARNING "PCI: bridge %s does not support I/O forwarding!\n", bridge->name); return 0; } void __init pcibios_fixup_bus(struct pci_bus *bus) { /* Propogate hose info into the subordinate devices. */ struct pci_channel *hose = bus->sysdata; struct pci_dev *dev = bus->self; if (!dev) { /* Root bus */ bus->resource[0] = hose->io_resource; bus->resource[1] = hose->mem_resource; } else { /* This is a bridge. Do not care how it's initialized, just link its resources to the bus ones */ int i; for(i=0; i<3; i++) { bus->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES+i]; bus->resource[i]->name = bus->name; } bus->resource[0]->flags |= pci_bridge_check_io(dev); bus->resource[1]->flags |= IORESOURCE_MEM; /* For now, propogate hose limits to the bus; we'll adjust them later. */ bus->resource[0]->end = hose->io_resource->end; bus->resource[1]->end = hose->mem_resource->end; /* Turn off downstream PF memory address range by default */ bus->resource[2]->start = 1024*1024; bus->resource[2]->end = bus->resource[2]->start - 1; } } char *pcibios_setup(char *str) { return str; } void pcibios_align_resource(void *data, struct resource *res, unsigned long size) { /* this should not be called */ MIPS_ASSERT(1 == 0); } void pcibios_update_resource(struct pci_dev *dev, struct resource *root, struct resource *res, int resource) { /* this should not be called */ MIPS_ASSERT(1 == 0); } --- NEW FILE --- /* * arch/ppc/kernel/pci_auto.c * * PCI autoconfiguration library * * Author: Matt Porter <mp...@mv...> * * Copyright 2000, 2001 MontaVista Software Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ /* * Modified for MIPS by Jun Sun, js...@mv... * * . Simplify the interface between pci_auto and the rest: a single function. * . Assign resources from low address to upper address. * . change most int to u32. */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/types.h> #include <linux/pci.h> #include <asm/ddb5xxx/pci.h> #include <asm/ddb5xxx/debug.h> #define DEBUG #ifdef DEBUG #define DBG(x...) printk(x) #else #define DBG(x...) #endif /* These are used for config access before all the PCI probing has been done. */ int early_read_config_byte(struct pci_channel *hose, int bus, int dev_fn, int where, u8 *val); int early_read_config_word(struct pci_channel *hose, int bus, int dev_fn, int where, u16 *val); int early_read_config_dword(struct pci_channel *hose, int bus, int dev_fn, int where, u32 *val); int early_write_config_byte(struct pci_channel *hose, int bus, int dev_fn, int where, u8 val); int early_write_config_word(struct pci_channel *hose, int bus, int dev_fn, int where, u16 val); int early_write_config_dword(struct pci_channel *hose, int bus, int dev_fn, int where, u32 val); static u32 pciauto_lower_iospc; static u32 pciauto_upper_iospc; static u32 pciauto_lower_memspc; static u32 pciauto_upper_memspc; void __init pciauto_setup_bars(struct pci_channel *hose, int current_bus, int pci_devfn) { u32 bar_response, bar_size, bar_value; u32 bar, addr_mask, bar_nr = 0; u32 * upper_limit; u32 * lower_limit; int found_mem64 = 0; DBG("PCI Autoconfig: Found Bus %d, Device %d, Function %d\n", current_bus, PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn) ); for (bar = PCI_BASE_ADDRESS_0; bar <= PCI_BASE_ADDRESS_5; bar+=4) { /* Tickle the BAR and get the response */ early_write_config_dword(hose, current_bus, pci_devfn, bar, 0xffffffff); early_read_config_dword(hose, current_bus, pci_devfn, bar, &bar_response); /* If BAR is not implemented go to the next BAR */ if (!bar_response) continue; /* Check the BAR type and set our address mask */ if (bar_response & PCI_BASE_ADDRESS_SPACE) { addr_mask = PCI_BASE_ADDRESS_IO_MASK; upper_limit = &pciauto_upper_iospc; lower_limit = &pciauto_lower_iospc; DBG("PCI Autoconfig: BAR %d, I/O, ", bar_nr); } else { if ( (bar_response & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64) found_mem64 = 1; addr_mask = PCI_BASE_ADDRESS_MEM_MASK; upper_limit = &pciauto_upper_memspc; lower_limit = &pciauto_lower_memspc; DBG("PCI Autoconfig: BAR %d, Mem, ", bar_nr); } /* Calculate requested size */ bar_size = ~(bar_response & addr_mask) + 1; /* Allocate a base address */ bar_value = ((*lower_limit - 1) & ~(bar_size - 1)) + bar_size; MIPS_ASSERT(bar_value + bar_size <= *upper_limit); /* Write it out and update our limit */ early_write_config_dword(hose, current_bus, pci_devfn, bar, bar_value); *lower_limit = bar_value + bar_size; /* * If we are a 64-bit decoder then increment to the * upper 32 bits of the bar and force it to locate * in the lower 4GB of memory. */ if (found_mem64) { bar += 4; early_write_config_dword(hose, current_bus, pci_devfn, bar, 0x00000000); } bar_nr++; DBG("size=0x%x, address=0x%x\n", bar_size, bar_value); } } void __init pciauto_prescan_setup_bridge(struct pci_channel *hose, int current_bus, int pci_devfn, int sub_bus) { int cmdstat; /* Configure bus number registers */ early_write_config_byte(hose, current_bus, pci_devfn, PCI_PRIMARY_BUS, current_bus); early_write_config_byte(hose, current_bus, pci_devfn, PCI_SECONDARY_BUS, sub_bus + 1); early_write_config_byte(hose, current_bus, pci_devfn, PCI_SUBORDINATE_BUS, 0xff); /* Round memory allocator to 1MB boundary */ pciauto_upper_memspc &= ~(0x100000 - 1); /* Round I/O allocator to 4KB boundary */ pciauto_upper_iospc &= ~(0x1000 - 1); /* Set up memory and I/O filter limits, assume 32-bit I/O space */ early_write_config_word(hose, current_bus, pci_devfn, PCI_MEMORY_LIMIT, ((pciauto_upper_memspc - 1) & 0xfff00000) >> 16); early_write_config_byte(hose, current_bus, pci_devfn, PCI_IO_LIMIT, ((pciauto_upper_iospc - 1) & 0x0000f000) >> 8); early_write_config_word(hose, current_bus, pci_devfn, PCI_IO_LIMIT_UPPER16, ((pciauto_upper_iospc - 1) & 0xffff0000) >> 16); /* We don't support prefetchable memory for now, so disable */ early_write_config_word(hose, current_bus, pci_devfn, PCI_PREF_MEMORY_BASE, 0x1000); early_write_config_word(hose, current_bus, pci_devfn, PCI_PREF_MEMORY_LIMIT, 0x1000); /* Enable memory and I/O accesses, enable bus master */ early_read_config_dword(hose, current_bus, pci_devfn, PCI_COMMAND, &cmdstat); early_write_config_dword(hose, current_bus, pci_devfn, PCI_COMMAND, cmdstat | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); } void __init pciauto_postscan_setup_bridge(struct pci_channel *hose, int current_bus, int pci_devfn, int sub_bus) { /* Configure bus number registers */ early_write_config_byte(hose, current_bus, pci_devfn, PCI_SUBORDINATE_BUS, sub_bus); /* Round memory allocator to 1MB boundary */ pciauto_upper_memspc &= ~(0x100000 - 1); early_write_config_word(hose, current_bus, pci_devfn, PCI_MEMORY_BASE, pciauto_upper_memspc >> 16); /* Round I/O allocator to 4KB boundary */ pciauto_upper_iospc &= ~(0x1000 - 1); early_write_config_byte(hose, current_bus, pci_devfn, PCI_IO_BASE, (pciauto_upper_iospc & 0x0000f000) >> 8); early_write_config_word(hose, current_bus, pci_devfn, PCI_IO_BASE_UPPER16, pciauto_upper_iospc >> 16); } #define PCIAUTO_IDE_MODE_MASK 0x05 int __init pciauto_bus_scan(struct pci_channel *hose, int current_bus) { int sub_bus; u32 pci_devfn, pci_class, cmdstat, found_multi=0; unsigned short vid; unsigned char header_type; sub_bus = current_bus; for (pci_devfn=0; pci_devfn<0xff; pci_devfn++) { if (PCI_FUNC(pci_devfn) && !found_multi) continue; early_read_config_byte(hose, current_bus, pci_devfn, PCI_HEADER_TYPE, &header_type); if (!PCI_FUNC(pci_devfn)) found_multi = header_type & 0x80; early_read_config_word(hose, current_bus, pci_devfn, PCI_VENDOR_ID, &vid); if (vid == 0xffff) continue; early_read_config_dword(hose, current_bus, pci_devfn, PCI_CLASS_REVISION, &pci_class); if ( (pci_class >> 16) == PCI_CLASS_BRIDGE_PCI ) { DBG("PCI Autoconfig: Found P2P bridge, device %d\n", PCI_SLOT(pci_devfn)); pciauto_prescan_setup_bridge(hose, current_bus, pci_devfn, sub_bus); sub_bus = pciauto_bus_scan(hose, sub_bus+1); pciauto_postscan_setup_bridge(hose, current_bus, pci_devfn, sub_bus); } else if ((pci_class >> 16) == PCI_CLASS_STORAGE_IDE) { unsigned char prg_iface; early_read_config_byte(hose, current_bus, pci_devfn, PCI_CLASS_PROG, &prg_iface); if (!(prg_iface & PCIAUTO_IDE_MODE_MASK)) { DBG("PCI Autoconfig: Skipping legacy mode IDE controller\n"); continue; } } /* * Found a peripheral, enable some standard * settings */ early_read_config_dword(hose, current_bus, pci_devfn, PCI_COMMAND, &cmdstat); early_write_config_dword(hose, current_bus, pci_devfn, PCI_COMMAND, cmdstat | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); early_write_config_byte(hose, current_bus, pci_devfn, PCI_LATENCY_TIMER, 0x80); /* Allocate PCI I/O and/or memory space */ pciauto_setup_bars(hose, current_bus, pci_devfn); } return sub_bus; } int __init pciauto_assign_resources(int busno, struct pci_channel *hose) { /* setup resource limits */ pciauto_lower_iospc = hose->io_resource->start; pciauto_upper_iospc = hose->io_resource->end + 1; pciauto_lower_memspc = hose->mem_resource->start; pciauto_upper_memspc = hose->mem_resource->end + 1; return pciauto_bus_scan(hose, busno); } /* * These functions are used early on before PCI scanning is done * and all of the pci_dev and pci_bus structures have been created. */ static struct pci_dev * fake_pci_dev(struct pci_channel *hose, int busnr, int devfn) { static struct pci_dev dev; static struct pci_bus bus; dev.bus = &bus; dev.sysdata = hose; dev.devfn = devfn; bus.number = busnr; bus.ops = hose->pci_ops; return &dev; } #define EARLY_PCI_OP(rw, size, type) \ int early_##rw##_config_##size(struct pci_channel *hose, int bus, \ int devfn, int offset, type value) \ { \ return pci_##rw##_config_##size(fake_pci_dev(hose, bus, devfn), \ offset, value); \ } EARLY_PCI_OP(read, byte, u8 *) EARLY_PCI_OP(read, word, u16 *) EARLY_PCI_OP(read, dword, u32 *) EARLY_PCI_OP(write, byte, u8) EARLY_PCI_OP(write, word, u16) EARLY_PCI_OP(write, dword, u32) --- NEW FILE --- /*********************************************************************** * * Copyright 2001 MontaVista Software Inc. * Author: js...@mv... or js...@ju... * * arch/mips/ddb5xxx/common/prom.c * prom.c file. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * *********************************************************************** */ #include <linux/config.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/sched.h> #include <linux/bootmem.h> #include <asm/addrspace.h> #include <asm/bootinfo.h> #include <asm/ddb5xxx/ddb5xxx.h> char arcs_cmdline[COMMAND_LINE_SIZE]; /* [js...@ju...] PMON passes arguments in C main() style */ void __init prom_init(int argc, const char **arg) { int i; /* arg[0] is "g", the rest is boot parameters */ arcs_cmdline[0] = '\0'; for (i = 1; i < argc; i++) { if (strlen(arcs_cmdline) + strlen(arg[i] + 1) >= sizeof(arcs_cmdline)) break; strcat(arcs_cmdline, arg[i]); strcat(arcs_cmdline, " "); } mips_machgroup = MACH_GROUP_NEC_DDB; #if defined(CONFIG_DDB5074) mips_machtype = MACH_NEC_DDB5074; #elif defined(CONFIG_DDB5476) mips_machtype = MACH_NEC_DDB5476; #elif defined(CONFIG_DDB5477) mips_machtype = MACH_NEC_DDB5477; #endif add_memory_region(0, DDB_SDRAM_SIZE, BOOT_MEM_RAM); } void __init prom_free_prom_memory(void) { } --- NEW FILE --- /* * Copyright 2001 MontaVista Software Inc. * Author: js...@mv... or js...@ju... * * arch/mips/ddb5xxx/common/rtc_ds1386.c * low-level RTC hookups for s for Dallas 1396 chip. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ /* * This file exports a function, rtc_ds1386_init(), which expects an * uncached base address as the argument. It will set the two function * pointers expected by the MIPS generic timer code. */ #include <linux/types.h> #include <linux/time.h> #include <asm/time.h> #include <asm/addrspace.h> #include <asm/ddb5xxx/debug.h> #define EPOCH 2000 #undef BCD_TO_BIN #define BCD_TO_BIN(val) (((val)&15) + ((val)>>4)*10) #undef BIN_TO_BCD #define BIN_TO_BCD(val) ((((val)/10)<<4) + (val)%10) #define READ_RTC(x) *(volatile unsigned char*)(rtc_base+x) #define WRITE_RTC(x, y) *(volatile unsigned char*)(rtc_base+x) = y static unsigned long rtc_base; static unsigned long rtc_ds1386_get_time(void) { u8 byte; u8 temp; unsigned int year, month, day, hour, minute, second; /* let us freeze external registers */ byte = READ_RTC(0xB); byte &= 0x3f; WRITE_RTC(0xB, byte); /* read time data */ year = BCD_TO_BIN(READ_RTC(0xA)) + EPOCH; month = BCD_TO_BIN(READ_RTC(0x9) & 0x1f); day = BCD_TO_BIN(READ_RTC(0x8)); minute = BCD_TO_BIN(READ_RTC(0x2)); second = BCD_TO_BIN(READ_RTC(0x1)); /* hour is special - deal with it later */ temp = READ_RTC(0x4); /* enable time transfer */ byte |= 0x80; WRITE_RTC(0xB, byte); /* calc hour */ if (temp & 0x40) { /* 12 hour format */ hour = BCD_TO_BIN(temp & 0x1f); if (temp & 0x20) hour += 12; /* PM */ } else { /* 24 hour format */ hour = BCD_TO_BIN(temp & 0x3f); } return mktime(year, month, day, hour, minute, second); } static int rtc_ds1386_set_time(unsigned long t) { struct rtc_time tm; u8 byte; u8 temp; u8 year, month, day, hour, minute, second; /* let us freeze external registers */ byte = READ_RTC(0xB); byte &= 0x3f; WRITE_RTC(0xB, byte); /* convert */ to_tm(t, &tm); /* check each field one by one */ year = BIN_TO_BCD(tm.tm_year - EPOCH); if (year != READ_RTC(0xA)) { WRITE_RTC(0xA, year); } temp = READ_RTC(0x9); month = BIN_TO_BCD(tm.tm_mon); if (month != (temp & 0x1f)) { WRITE_RTC( 0x9, (month & 0x1f) | (temp & ~0x1f) ); } day = BIN_TO_BCD(tm.tm_mday); if (day != READ_RTC(0x8)) { WRITE_RTC(0x8, day); } temp = READ_RTC(0x4); if (temp & 0x40) { /* 12 hour format */ hour = 0x40; if (tm.tm_hour > 12) { hour |= 0x20 | (BIN_TO_BCD(hour-12) & 0x1f); } else { hour |= BIN_TO_BCD(tm.tm_hour); } } else { /* 24 hour format */ hour = BIN_TO_BCD(tm.tm_hour) & 0x3f; } if (hour != temp) WRITE_RTC(0x4, hour); minute = BIN_TO_BCD(tm.tm_min); if (minute != READ_RTC(0x2)) { WRITE_RTC(0x2, minute); } second = BIN_TO_BCD(tm.tm_sec); if (second != READ_RTC(0x1)) { WRITE_RTC(0x1, second); } return 0; } void rtc_ds1386_init(unsigned long base) { unsigned char byte; /* remember the base */ rtc_base = base; MIPS_ASSERT((rtc_base & 0xe0000000) == KSEG1); /* turn on RTC if it is not on */ byte = READ_RTC(0x9); if (byte & 0x80) { byte &= 0x7f; WRITE_RTC(0x9, byte); } /* enable time transfer */ byte = READ_RTC(0xB); byte |= 0x80; WRITE_RTC(0xB, byte); /* set the function pointers */ rtc_get_time = rtc_ds1386_get_time; rtc_set_time = rtc_ds1386_set_time; } |
From: Andy P. <at...@us...> - 2002-04-10 18:30:53
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/pmac In directory usw-pr-cvs1:/tmp/cvs-serv25860/ppc/boot/pmac Added Files: Makefile chrpmain.c coffmain.c dummy.c ld.script misc.S start.c Log Message: synch 2.4.15 commit 43 --- NEW FILE --- # BK Id: SCCS/s.Makefile 1.14 07/27/01 20:24:17 trini # # Makefile for making XCOFF bootable images for booting on PowerMacs # using Open Firmware. # # Paul Mackerras January 1997 # # Cleaned up, moved into arch/ppc/boot/pmac # Tom Rini January 2001 OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment COFF_LD_ARGS = -e _start -T ld.script -Ttext 500000 -Tdata 510000 -Bstatic CHRP_LD_ARGS = -Ttext 0x01000000 COMMONOBJS = start.o misc.o ../common/string.o image.o ../common/ofcommon.o COFFOBJS = ../common/coffcrt0.o $(COMMONOBJS) coffmain.o CHRPOBJS = ../common/crt0.o $(COMMONOBJS) chrpmain.o LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a MKNOTE := ../utils/mknote SIZE := ../utils/size OFFSET := ../utils/offset PIGGYBACK := ../utils/piggyback HACKCOFF := ../utils/hack-coff ifeq ($(CONFIG_PPC64BRIDGE),y) MSIZE=.64 else MSIZE= endif ifeq ($(CONFIG_SMP),y) TFTPIMAGE=/tftpboot/zImage.pmac.smp$(MSIZE) else TFTPIMAGE=/tftpboot/zImage.pmac$(MSIZE) endif ../common/crt0.o: $(MAKE) -C ../common crt0.o ../common/coffcrt0.o: $(MAKE) -C ../common coffcrt0.o chrpmain.o: chrpmain.c $(CC) $(CFLAGS) -DSYSMAP_OFFSET=0 -DSYSMAP_SIZE=0 -c chrpmain.c znetboot: vmlinux.coff vmlinux.elf-pmac zImage cp ../images/vmlinux.coff $(TFTPIMAGE) cp ../images/vmlinux.elf-pmac $(TFTPIMAGE).elf znetboot.initrd: vmlinux.coff.initrd vmlinux.initrd.elf-pmac cp ../images/vmlinux.coff.initrd $(TFTPIMAGE) cp ../images/vmlinux.elf-pmac.initrd $(TFTPIMAGE).elf #floppy: zImage # mount -t hfs /dev/fd0 /mnt # cp vmlinux.coff /mnt # umount /mnt miboot.image: dummy.o ../images/vmlinux.gz $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=../images/vmlinux.gz \ dummy.o ../images/$@ miboot.image.initrd: miboot.image ../images/ramdisk.image.gz $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=initrd=../images/ramdisk.image.gz \ ../images/miboot.image ../images/$@ coffboot: $(COFFOBJS) $(LIBS) ../common/no_initrd.o ld.script ../images/vmlinux.gz $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) ../common/no_initrd.o $(LIBS) coffboot.initrd: $(COFFOBJS) $(LIBS) initrd.o ld.script ../images/vmlinux.gz $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) initrd.o $(LIBS) image.o: $(PIGGYBACK) ../images/vmlinux.gz $(PIGGYBACK) image < ../images/vmlinux.gz | $(AS) -o $@ initrd.o: ../images/ramdisk.image.gz $(PIGGYBACK) $(PIGGYBACK) initrd < ../images/ramdisk.image.gz | $(AS) -o $@ vmlinux.coff: coffboot $(HACKCOFF) $(OBJCOPY) $(OBJCOPY_ARGS) coffboot ../images/$@ $(HACKCOFF) ../images/$@ rm -f coffboot ln -sf vmlinux.coff ../images/zImage.pmac vmlinux.coff.initrd: coffboot.initrd $(HACKCOFF) $(OBJCOPY) $(OBJCOPY_ARGS) coffboot.initrd ../images/$@ $(HACKCOFF) ../images/$@ rm -f coffboot.initrd ln -sf vmlinux.coff.initrd ../images/zImage.initrd.pmac vmlinux.elf-pmac: $(CHRPOBJS) $(LIBS) ../common/no_initrd.o $(MKNOTE) ../images/vmlinux.gz $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) ../common/no_initrd.o $(LIBS) $(MKNOTE) > note $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note \ --add-section=sysmap=$(TOPDIR)/System.map -R .comment $(CC) $(CFLAGS) chrpmain.c -c -o chrpmain.o \ -DSYSMAP_OFFSET=`sh $(OFFSET) $(OBJDUMP) ../images/$@ sysmap` \ -DSYSMAP_SIZE=`sh $(SIZE) $(OBJDUMP) ../images/$@ sysmap` $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) ../common/no_initrd.o $(LIBS) $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note \ --add-section=sysmap=$(TOPDIR)/System.map -R .comment rm -f note vmlinux.initrd.elf-pmac: $(CHRPOBJS) $(LIBS) initrd.o $(MKNOTE) ../images/vmlinux.gz $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) initrd.o $(LIBS) $(MKNOTE) > note $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note -R .comment rm -f note zImage: vmlinux.coff vmlinux.elf-pmac miboot.image zImage.initrd: vmlinux.coff.initrd vmlinux.initrd.elf-pmac miboot.image.initrd include $(TOPDIR)/Rules.make --- NEW FILE --- /* * BK Id: SCCS/s.chrpmain.c 1.16 07/27/01 20:24:18 trini */ /* * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include "nonstdio.h" #include "zlib.h" #include <asm/processor.h> extern char _end[]; extern char image_data[], initrd_data[]; extern int image_len, initrd_len; extern int getprop(void *, const char *, void *, int); extern unsigned int heap_max; extern void *claim(unsigned int, unsigned int, unsigned int); extern void *finddevice(const char *); extern void flush_cache(void *start, unsigned int len); extern void gunzip(void *, int, unsigned char *, int *); extern void make_bi_recs(unsigned long addr, char *name, unsigned int mach, unsigned int progend); extern void pause(void); extern void release(void *ptr, unsigned int len); char *avail_ram; char *begin_avail, *end_avail; char *avail_high; #define RAM_END (16 << 20) #define PROG_START 0x00010000 #define PROG_SIZE 0x003f0000 #define SCRATCH_SIZE (128 << 10) void boot(int a1, int a2, void *prom) { unsigned sa, len; void *dst; unsigned char *im; unsigned initrd_start, initrd_size; extern char _start; printf("chrpboot starting: loaded at 0x%p\n", &_start); if (initrd_len) { initrd_size = initrd_len; initrd_start = (RAM_END - initrd_size) & ~0xFFF; a1 = initrd_start; a2 = initrd_size; claim(initrd_start, RAM_END - initrd_start, 0); printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n", initrd_start, initrd_data,initrd_size); memcpy((char *)initrd_start, initrd_data, initrd_size); } im = image_data; len = image_len; /* claim 3MB starting at PROG_START */ claim(PROG_START, PROG_SIZE, 0); dst = (void *) PROG_START; if (im[0] == 0x1f && im[1] == 0x8b) { /* claim some memory for scratch space */ avail_ram = (char *) claim(0, SCRATCH_SIZE, 0x10); begin_avail = avail_high = avail_ram; end_avail = avail_ram + SCRATCH_SIZE; printf("heap at 0x%p\n", avail_ram); printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len); gunzip(dst, PROG_SIZE, im, &len); printf("done %u bytes\n", len); printf("%u bytes of heap consumed, max in use %u\n", avail_high - begin_avail, heap_max); release(begin_avail, SCRATCH_SIZE); } else { memmove(dst, im, len); } flush_cache(dst, len); make_bi_recs(((unsigned long) dst + len), "chrpboot", _MACH_Pmac, (PROG_START + PROG_SIZE)); sa = (unsigned long)PROG_START; printf("start address = 0x%x\n", sa); (*(void (*)())sa)(a1, a2, prom); printf("returned?\n"); pause(); } --- NEW FILE --- /* * BK Id: SCCS/s.coffmain.c 1.14 07/27/01 20:24:18 trini */ /* * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include "nonstdio.h" #include "zlib.h" #include <asm/processor.h> extern char _start[], _end[]; extern char *claim(unsigned, unsigned, unsigned); extern char image_data[], initrd_data[]; extern int initrd_len, image_len; extern int getprop(void *, const char *, void *, int); extern unsigned int heap_max; extern void *finddevice(const char *); extern void flush_cache(void *start, unsigned int len); extern void gunzip(void *, int, unsigned char *, int *); extern void make_bi_recs(unsigned long addr, char *name, unsigned int mach, unsigned int progend); extern void pause(void); extern void setup_bats(unsigned long start); char *avail_ram; char *begin_avail, *end_avail; char *avail_high; #define RAM_START 0 #define RAM_END (RAM_START + 0x800000) /* only 8M mapped with BATs */ #define PROG_START RAM_START #define PROG_SIZE 0x00400000 #define SCRATCH_SIZE (128 << 10) static char heap[SCRATCH_SIZE]; void boot(int a1, int a2, void *prom) { unsigned sa, len; void *dst; unsigned char *im; unsigned initrd_start, initrd_size; printf("coffboot starting: loaded at 0x%p\n", &_start); setup_bats(RAM_START); if (initrd_len) { initrd_size = initrd_len; initrd_start = (RAM_END - initrd_size) & ~0xFFF; a1 = initrd_start; a2 = initrd_size; claim(initrd_start - RAM_START, RAM_END - initrd_start, 0); printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n", initrd_start, initrd_data, initrd_size); memcpy((char *)initrd_start, initrd_data, initrd_size); } im = image_data; len = image_len; /* claim 4MB starting at 0 */ claim(0, PROG_SIZE, 0); dst = (void *) RAM_START; if (im[0] == 0x1f && im[1] == 0x8b) { /* set up scratch space */ begin_avail = avail_high = avail_ram = heap; end_avail = heap + sizeof(heap); printf("heap at 0x%p\n", avail_ram); printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len); gunzip(dst, PROG_SIZE, im, &len); printf("done %u bytes\n", len); printf("%u bytes of heap consumed, max in use %u\n", avail_high - begin_avail, heap_max); } else { memmove(dst, im, len); } flush_cache(dst, len); make_bi_recs(((unsigned long) dst + len), "coffboot", _MACH_Pmac, (PROG_START + PROG_SIZE)); sa = (unsigned long)PROG_START; printf("start address = 0x%x\n", sa); (*(void (*)())sa)(a1, a2, prom); printf("returned?\n"); pause(); } --- NEW FILE --- /* * BK Id: SCCS/s.dummy.c 1.6 05/18/01 15:17:15 cort */ int main(void) { return 0; } --- NEW FILE --- OUTPUT_ARCH(powerpc) SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); /* Do we need any of these for elf? __DYNAMIC = 0; */ SECTIONS { /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } .rel.text : { *(.rel.text) } .rela.text : { *(.rela.text) } .rel.data : { *(.rel.data) } .rela.data : { *(.rela.data) } .rel.rodata : { *(.rel.rodata) } .rela.rodata : { *(.rela.rodata) } .rel.got : { *(.rel.got) } .rela.got : { *(.rela.got) } .rel.ctors : { *(.rel.ctors) } .rela.ctors : { *(.rela.ctors) } .rel.dtors : { *(.rel.dtors) } .rela.dtors : { *(.rela.dtors) } .rel.bss : { *(.rel.bss) } .rela.bss : { *(.rela.bss) } .rel.plt : { *(.rel.plt) } .rela.plt : { *(.rela.plt) } .init : { *(.init) } =0 .plt : { *(.plt) } .text : { *(.text) *(.rodata) *(.rodata.*) *(.rodata1) *(.got1) } .fini : { *(.fini) } =0 .ctors : { *(.ctors) } .dtors : { *(.dtors) } _etext = .; PROVIDE (etext = .); /* Read-write section, merged into data segment: */ . = (. + 0x0FFF) & 0xFFFFF000; .data : { *(.data) *(.data1) *(.sdata) *(.sdata2) *(.got.plt) *(.got) *(.dynamic) CONSTRUCTORS } _edata = .; PROVIDE (edata = .); __bss_start = .; .bss : { *(.sbss) *(.scommon) *(.dynbss) *(.bss) *(COMMON) } _end = . ; PROVIDE (end = .); } --- NEW FILE --- /* * BK Id: SCCS/s.misc.S 1.6 05/18/01 15:17:15 cort */ /* * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ .text /* * Use the BAT3 registers to map the 1st 8MB of RAM to * the address given as the 1st argument. */ .globl setup_bats setup_bats: mfpvr 5 rlwinm 5,5,16,16,31 /* r3 = 1 for 601, 4 for 604 */ cmpi 0,5,1 li 0,0 bne 4f mtibatl 3,0 /* invalidate BAT first */ ori 3,3,4 /* set up BAT registers for 601 */ li 4,0x7f mtibatu 3,3 mtibatl 3,4 b 5f 4: mtdbatu 3,0 /* invalidate BATs first */ mtibatu 3,0 ori 3,3,0xff /* set up BAT registers for 604 */ li 4,2 mtdbatl 3,4 mtdbatu 3,3 mtibatl 3,4 mtibatu 3,3 5: sync isync blr /* * Flush the dcache and invalidate the icache for a range of addresses. * * flush_cache(addr, len) */ .global flush_cache flush_cache: addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */ rlwinm. 4,4,27,5,31 mtctr 4 beqlr 1: dcbf 0,3 icbi 0,3 addi 3,3,0x20 bdnz 1b sync isync blr --- NEW FILE --- /* * BK Id: SCCS/s.start.c 1.10 07/25/01 18:13:07 trini */ /* * Copyright (C) Paul Mackerras 1997. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <stdarg.h> extern int strlen(const char *s); extern void boot(int a1, int a2, void *prom); int (*prom)(); void *chosen_handle; void *stdin; void *stdout; void *stderr; void exit(void); void *finddevice(const char *name); int getprop(void *phandle, const char *name, void *buf, int buflen); void printk(char *fmt, ...); void start(int a1, int a2, void *promptr) { prom = (int (*)()) promptr; chosen_handle = finddevice("/chosen"); if (chosen_handle == (void *) -1) exit(); if (getprop(chosen_handle, "stdout", &stdout, sizeof(stdout)) != 4) exit(); stderr = stdout; if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4) exit(); boot(a1, a2, promptr); for (;;) exit(); } int write(void *handle, void *ptr, int nb) { struct prom_args { char *service; int nargs; int nret; void *ihandle; void *addr; int len; int actual; } args; args.service = "write"; args.nargs = 3; args.nret = 1; args.ihandle = handle; args.addr = ptr; args.len = nb; args.actual = -1; (*prom)(&args); return args.actual; } int writestring(void *f, char *ptr, int nb) { int w = 0, i; char *ret = "\r"; for (i = 0; i < nb; ++i) { if (ptr[i] == '\n') { if (i > w) { write(f, ptr + w, i - w); w = i; } write(f, ret, 1); } } if (w < nb) write(f, ptr + w, nb - w); return nb; } int read(void *handle, void *ptr, int nb) { struct prom_args { char *service; int nargs; int nret; void *ihandle; void *addr; int len; int actual; } args; args.service = "read"; args.nargs = 3; args.nret = 1; args.ihandle = handle; args.addr = ptr; args.len = nb; args.actual = -1; (*prom)(&args); return args.actual; } void exit(void) { struct prom_args { char *service; } args; for (;;) { args.service = "exit"; (*prom)(&args); } } void pause(void) { struct prom_args { char *service; } args; args.service = "enter"; (*prom)(&args); } void * finddevice(const char *name) { struct prom_args { char *service; int nargs; int nret; const char *devspec; void *phandle; } args; args.service = "finddevice"; args.nargs = 1; args.nret = 1; args.devspec = name; args.phandle = (void *) -1; (*prom)(&args); return args.phandle; } void * claim(unsigned int virt, unsigned int size, unsigned int align) { struct prom_args { char *service; int nargs; int nret; unsigned int virt; unsigned int size; unsigned int align; void *ret; } args; args.service = "claim"; args.nargs = 3; args.nret = 1; args.virt = virt; args.size = size; args.align = align; (*prom)(&args); return args.ret; } void release(void *virt, unsigned int size) { struct prom_args { char *service; int nargs; int nret; void *virt; unsigned int size; } args; args.service = "release"; args.nargs = 2; args.nret = 0; args.virt = virt; args.size = size; (*prom)(&args); } int getprop(void *phandle, const char *name, void *buf, int buflen) { struct prom_args { char *service; int nargs; int nret; void *phandle; const char *name; void *buf; int buflen; int size; } args; args.service = "getprop"; args.nargs = 4; args.nret = 1; args.phandle = phandle; args.name = name; args.buf = buf; args.buflen = buflen; args.size = -1; (*prom)(&args); return args.size; } int putc(int c, void *f) { char ch = c; return writestring(f, &ch, 1) == 1? c: -1; } int putchar(int c) { return putc(c, stdout); } int fputs(char *str, void *f) { int n = strlen(str); return writestring(f, str, n) == n? 0: -1; } int readchar(void) { char ch; for (;;) { switch (read(stdin, &ch, 1)) { case 1: return ch; case -1: printk("read(stdin) returned -1\n"); return -1; } } } static char line[256]; static char *lineptr; static int lineleft; int getchar(void) { int c; if (lineleft == 0) { lineptr = line; for (;;) { c = readchar(); if (c == -1 || c == 4) break; if (c == '\r' || c == '\n') { *lineptr++ = '\n'; putchar('\n'); break; } switch (c) { case 0177: case '\b': if (lineptr > line) { putchar('\b'); putchar(' '); putchar('\b'); --lineptr; } break; case 'U' & 0x1F: while (lineptr > line) { putchar('\b'); putchar(' '); putchar('\b'); --lineptr; } break; default: if (lineptr >= &line[sizeof(line) - 1]) putchar('\a'); else { putchar(c); *lineptr++ = c; } } } lineleft = lineptr - line; lineptr = line; } if (lineleft == 0) return -1; --lineleft; return *lineptr++; } extern int vsprintf(char *buf, const char *fmt, va_list args); static char sprint_buf[1024]; void printk(char *fmt, ...) { va_list args; int n; va_start(args, fmt); n = vsprintf(sprint_buf, fmt, args); va_end(args); writestring(stdout, sprint_buf, n); } int printf(char *fmt, ...) { va_list args; int n; va_start(args, fmt); n = vsprintf(sprint_buf, fmt, args); va_end(args); writestring(stdout, sprint_buf, n); return n; } |
From: Andy P. <at...@us...> - 2002-04-10 18:30:52
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/isdn/icn In directory usw-pr-cvs1:/tmp/cvs-serv1502/isdn/icn Modified Files: icn.c icn.h Log Message: synch 2.4.15 commit 49 Index: icn.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/icn/icn.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- icn.c 14 Jan 2001 18:38:58 -0000 1.1.1.1 +++ icn.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,26 +1,34 @@ /* $Id$ - + * * ISDN low-level module for the ICN active ISDN-Card. * * Copyright 1994,95,96 by Fritz Elfert (fr...@is...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ #include "icn.h" +#include <linux/module.h> +#include <linux/init.h> + +static int portbase = ICN_BASEADDR; +static unsigned long membase = ICN_MEMADDR; +static char *icn_id = "\0"; +static char *icn_id2 = "\0"; + +MODULE_DESCRIPTION("ISDN4Linux: Driver for ICN active ISDN card"); +MODULE_AUTHOR("Fritz Elfert"); +MODULE_LICENSE("GPL"); +MODULE_PARM(portbase, "i"); +MODULE_PARM_DESC(portbase, "Port address of first card"); +MODULE_PARM(membase, "l"); +MODULE_PARM_DESC(membase, "Shared memory address of all cards"); +MODULE_PARM(icn_id, "s"); +MODULE_PARM_DESC(icn_id, "ID-String of first card"); +MODULE_PARM(icn_id2, "s"); +MODULE_PARM_DESC(icn_id2, "ID-String of first card, second S0 (4B only)"); /* * Verbose bootcode- and protocol-downloading. @@ -50,8 +58,7 @@ struct sk_buff *skb; unsigned long flags; - while ((skb = skb_dequeue(queue))) - dev_kfree_skb(skb); + skb_queue_purge(queue); save_flags(flags); cli(); card->xlen[channel] = 0; @@ -607,7 +614,7 @@ int left; u_char c; int ch; - int flags; + unsigned long flags; int i; u_char *p; isdn_ctrl cmd; @@ -804,8 +811,8 @@ icn_loadboot(u_char * buffer, icn_card * card) { int ret; - ulong flags; u_char *codebuf; + unsigned long flags; #ifdef BOOT_DEBUG printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) buffer); @@ -818,8 +825,6 @@ kfree(codebuf); return ret; } - save_flags(flags); - cli(); if (!card->rvalid) { if (check_region(card->port, ICN_PORTLEN)) { printk(KERN_WARNING @@ -827,7 +832,6 @@ CID, card->port, card->port + ICN_PORTLEN); - restore_flags(flags); kfree(codebuf); return -EBUSY; } @@ -837,23 +841,21 @@ card->other->rvalid = 1; } if (!dev.mvalid) { - if (check_shmem((ulong) dev.shmem, 0x4000)) { + if (check_mem_region(dev.memaddr, 0x4000)) { printk(KERN_WARNING - "icn: memory at 0x%08lx in use.\n", - (ulong) dev.shmem); - restore_flags(flags); + "icn: memory at 0x%08lx in use.\n", dev.memaddr); return -EBUSY; } - request_shmem((ulong) dev.shmem, 0x4000, "icn"); + request_mem_region(dev.memaddr, 0x4000, "icn-isdn (all cards)"); + dev.shmem = ioremap(dev.memaddr, 0x4000); dev.mvalid = 1; } - restore_flags(flags); OUTB_P(0, ICN_RUN); /* Reset Controller */ OUTB_P(0, ICN_MAPRAM); /* Disable RAM */ icn_shiftout(ICN_CFG, 0x0f, 3, 4); /* Windowsize= 16k */ - icn_shiftout(ICN_CFG, (unsigned long) dev.shmem, 23, 10); /* Set RAM-Addr. */ + icn_shiftout(ICN_CFG, dev.memaddr, 23, 10); /* Set RAM-Addr. */ #ifdef BOOT_DEBUG - printk(KERN_DEBUG "shmem=%08lx\n", (ulong) dev.shmem); + printk(KERN_DEBUG "shmem=%08lx\n", dev.memaddr); #endif SLEEP(1); #ifdef BOOT_DEBUG @@ -867,7 +869,7 @@ SLEEP(1); memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */ #ifdef BOOT_DEBUG - printk(KERN_DEBUG "Bootloader transfered\n"); + printk(KERN_DEBUG "Bootloader transferred\n"); #endif if (card->doubleS0) { SLEEP(1); @@ -883,7 +885,7 @@ SLEEP(1); memcpy_toio(dev.shmem, codebuf, ICN_CODE_STAGE1); /* Copy code */ #ifdef BOOT_DEBUG - printk(KERN_DEBUG "Bootloader transfered\n"); + printk(KERN_DEBUG "Bootloader transferred\n"); #endif } kfree(codebuf); @@ -935,7 +937,9 @@ restore_flags(flags); while (left) { if (sbfree) { /* If there is a free buffer... */ - cnt = MIN(256, left); + cnt = left; + if (cnt > 256) + cnt = 256; if (copy_from_user(codebuf, p, cnt)) { icn_maprelease_channel(card, 0); return -EFAULT; @@ -1034,7 +1038,6 @@ icn_writecmd(const u_char * buf, int len, int user, icn_card * card) { int mch = card->secondhalf ? 2 : 0; - int avail; int pp; int i; int count; @@ -1051,18 +1054,20 @@ ocount = 1; xcount = loop = 0; while (len) { + count = cmd_free; + if (count > len) + count = len; + if (user) + copy_from_user(msg, buf, count); + else + memcpy(msg, buf, count); + save_flags(flags); cli(); lastmap_card = dev.mcard; lastmap_channel = dev.channel; icn_map_channel(card, mch); - avail = cmd_free; - count = MIN(avail, len); - if (user) - copy_from_user(msg, buf, count); - else - memcpy(msg, buf, count); icn_putmsg(card, '>'); for (p = msg, pp = readb(&cmd_i), i = count; i > 0; i--, p++, pp ++) { @@ -1140,10 +1145,7 @@ icn_disable_cards(void) { icn_card *card = cards; - unsigned long flags; - save_flags(flags); - cli(); while (card) { if (check_region(card->port, ICN_PORTLEN)) { printk(KERN_WARNING @@ -1151,14 +1153,12 @@ CID, card->port, card->port + ICN_PORTLEN); - cli(); } else { OUTB_P(0, ICN_RUN); /* Reset Controller */ OUTB_P(0, ICN_MAPRAM); /* Disable RAM */ } card = card->next; } - restore_flags(flags); } static int @@ -1176,29 +1176,31 @@ memcpy(&a, c->parm.num, sizeof(ulong)); switch (c->arg) { case ICN_IOCTL_SETMMIO: - if ((unsigned long) dev.shmem != (a & 0x0ffc000)) { - if (check_shmem((ulong) (a & 0x0ffc000), 0x4000)) { + if (dev.memaddr != (a & 0x0ffc000)) { + if (check_mem_region(a & 0x0ffc000, 0x4000)) { printk(KERN_WARNING "icn: memory at 0x%08lx in use.\n", - (ulong) (a & 0x0ffc000)); + a & 0x0ffc000); return -EINVAL; } icn_stopallcards(); save_flags(flags); cli(); - if (dev.mvalid) - release_shmem((ulong) dev.shmem, 0x4000); + if (dev.mvalid) { + iounmap(dev.shmem); + release_mem_region(dev.memaddr, 0x4000); + } dev.mvalid = 0; - dev.shmem = (icn_shmem *) (a & 0x0ffc000); + dev.memaddr = a & 0x0ffc000; restore_flags(flags); printk(KERN_INFO "icn: (%s) mmio set to 0x%08lx\n", CID, - (unsigned long) dev.shmem); + dev.memaddr); } break; case ICN_IOCTL_GETMMIO: - return (long) dev.shmem; + return (long) dev.memaddr; case ICN_IOCTL_SETPORT: if (a == 0x300 || a == 0x310 || a == 0x320 || a == 0x330 || a == 0x340 || a == 0x350 || a == 0x360 || @@ -1601,25 +1603,19 @@ static int icn_addcard(int port, char *id1, char *id2) { - ulong flags; icn_card *card; icn_card *card2; - save_flags(flags); - cli(); if (!(card = icn_initcard(port, id1))) { - restore_flags(flags); return -EIO; } if (!strlen(id2)) { - restore_flags(flags); printk(KERN_INFO "icn: (%s) ICN-2B, port 0x%x added\n", card->interface.id, port); return 0; } if (!(card2 = icn_initcard(port, id2))) { - restore_flags(flags); printk(KERN_INFO "icn: (%s) half ICN-4B, port 0x%x added\n", card2->interface.id, port); @@ -1631,17 +1627,13 @@ card2->doubleS0 = 1; card2->secondhalf = 1; card2->other = card; - restore_flags(flags); printk(KERN_INFO "icn: (%s and %s) ICN-4B, port 0x%x added\n", card->interface.id, card2->interface.id, port); return 0; } -#ifdef MODULE -#define icn_init init_module -#else -#include <linux/init.h> +#ifndef MODULE static int __init icn_setup(char *line) { @@ -1654,7 +1646,7 @@ if (ints[0]) portbase = ints[1]; if (ints[0] > 1) - membase = ints[2]; + membase = (unsigned long)ints[2]; if (str && *str) { strcpy(sid, str); icn_id = sid; @@ -1667,23 +1659,19 @@ return(1); } __setup("icn=", icn_setup); -#endif /* MODULES */ +#endif /* MODULE */ -int -icn_init(void) +static int __init icn_init(void) { char *p; char rev[10]; memset(&dev, 0, sizeof(icn_dev)); - dev.shmem = (icn_shmem *) ((unsigned long) membase & 0x0ffc000); + dev.memaddr = (membase & 0x0ffc000); dev.channel = -1; dev.mcard = NULL; dev.firstload = 1; - /* No symbols to export, hide all symbols */ - EXPORT_NO_SYMBOLS; - if ((p = strchr(revision, ':'))) { strcpy(rev, p + 1); p = strchr(rev, '$'); @@ -1691,13 +1679,11 @@ } else strcpy(rev, " ??? "); printk(KERN_NOTICE "ICN-ISDN-driver Rev%smem=0x%08lx\n", rev, - (ulong) dev.shmem); + dev.memaddr); return (icn_addcard(portbase, icn_id, icn_id2)); } -#ifdef MODULE -void -cleanup_module(void) +static void __exit icn_exit(void) { isdn_ctrl cmd; icn_card *card = cards; @@ -1727,8 +1713,12 @@ card = card->next; kfree(last); } - if (dev.mvalid) - release_shmem((ulong) dev.shmem, 0x4000); + if (dev.mvalid) { + iounmap(dev.shmem); + release_mem_region(dev.memaddr, 0x4000); + } printk(KERN_NOTICE "ICN-ISDN-driver unloaded\n"); } -#endif + +module_init(icn_init); +module_exit(icn_exit); Index: icn.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/icn/icn.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- icn.h 25 Feb 2001 23:15:09 -0000 1.1.1.2 +++ icn.h 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,22 +1,11 @@ /* $Id$ - + * * ISDN lowlevel-module for the ICN active ISDN-Card. * * Copyright 1994 by Fritz Elfert (fr...@is...) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * */ @@ -46,7 +35,6 @@ #ifdef __KERNEL__ /* Kernel includes */ -#include <linux/module.h> #include <linux/version.h> #include <linux/errno.h> #include <linux/fs.h> @@ -187,6 +175,7 @@ * Main driver data */ typedef struct icn_dev { + unsigned long memaddr; /* Address of memory mapped buffers */ icn_shmem *shmem; /* Pointer to memory-mapped-buffers */ int mvalid; /* IO-shmem has been requested */ int channel; /* Currently mapped channel */ @@ -205,27 +194,6 @@ static icn_dev dev; -/* With modutils >= 1.1.67 Integers can be changed while loading a - * module. For this reason define the Port-Base an Shmem-Base as - * integers. - */ -static int portbase = ICN_BASEADDR; -static int membase = ICN_MEMADDR; -static char *icn_id = "\0"; -static char *icn_id2 = "\0"; - -#ifdef MODULE -MODULE_AUTHOR("Fritz Elfert"); -MODULE_PARM(portbase, "i"); -MODULE_PARM_DESC(portbase, "Port adress of first card"); -MODULE_PARM(membase, "i"); -MODULE_PARM_DESC(membase, "Shared memory adress of all cards"); -MODULE_PARM(icn_id, "s"); -MODULE_PARM_DESC(icn_id, "ID-String of first card"); -MODULE_PARM(icn_id2, "s"); -MODULE_PARM_DESC(icn_id2, "ID-String of first card, second S0 (4B only)"); -#endif - #endif /* __KERNEL__ */ /* Utility-Macros */ @@ -283,17 +251,6 @@ readb(&msg_i)-readb(&msg_o)) #define CID (card->interface.id) - -#define MIN(a,b) ((a<b)?a:b) -#define MAX(a,b) ((a>b)?a:b) - -/* Hopefully, a separate resource-registration-scheme for shared-memory - * will be introduced into the kernel. Until then, we use the normal - * routines, designed for port-registration. - */ -#define check_shmem check_region -#define release_shmem release_region -#define request_shmem request_region #endif /* defined(__KERNEL__) || defined(__DEBUGVAR__) */ #endif /* icn_h */ |
From: Andy P. <at...@us...> - 2002-04-10 18:30:50
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit In directory usw-pr-cvs1:/tmp/cvs-serv1502/isdn/pcbit Modified Files: callbacks.c callbacks.h capi.c capi.h drv.c edss1.c edss1.h layer2.c layer2.h module.c pcbit.h Log Message: synch 2.4.15 commit 49 Index: callbacks.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/callbacks.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- callbacks.c 25 Feb 2001 23:15:09 -0000 1.1.1.2 +++ callbacks.c 10 Apr 2002 15:32:26 -0000 1.2 @@ -1,14 +1,12 @@ /* + * Callbacks for the FSM + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. - */ - -/* - * callbacks for the FSM + * the GNU General Public License, incorporated herein by reference. */ /* @@ -16,11 +14,6 @@ * Port of Nelson Escravana's <nel...@us...> fix to CalledPN * NULL pointer dereference in cb_in_1 (originally fixed in 2.0) */ - - -#define __NO_VERSION__ - -#include <linux/module.h> #include <linux/sched.h> #include <linux/string.h> Index: callbacks.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/callbacks.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- callbacks.h 14 Jan 2001 18:40:02 -0000 1.1.1.1 +++ callbacks.h 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,15 +1,12 @@ /* + * Callbacks prototypes for FSM + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. - */ - -/* - * Callbacks prototypes for FSM - * + * the GNU General Public License, incorporated herein by reference. */ #ifndef CALLBACKS_H Index: capi.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/capi.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- capi.c 25 Feb 2001 23:15:09 -0000 1.1.1.2 +++ capi.c 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,17 +1,16 @@ /* + * CAPI encoder/decoder for + * Portugal Telecom CAPI 2.0 + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. - */ - -/* - * CAPI encoder/decoder for - * Portugal Telecom CAPI 2.0 + * the GNU General Public License, incorporated herein by reference. + * + * Not compatible with the AVM Gmbh. CAPI 2.0 * - * Not compatible with the AVM Gmbh. CAPI 2.0 */ /* @@ -27,10 +26,6 @@ * for debug purposes mainly * encode our number in CallerPN and ConnectedPN */ - -#define __NO_VERSION__ - -#include <linux/module.h> #include <linux/sched.h> #include <linux/string.h> Index: capi.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/capi.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- capi.h 14 Jan 2001 18:40:04 -0000 1.1.1.1 +++ capi.h 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,14 +1,12 @@ /* + * CAPI encode/decode prototypes and defines + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. - */ - -/* - * CAPI encode/decode prototypes and defines + * the GNU General Public License, incorporated herein by reference. */ #ifndef CAPI_H Index: drv.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/drv.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- drv.c 25 Feb 2001 23:15:09 -0000 1.1.1.2 +++ drv.c 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,14 +1,12 @@ /* + * PCBIT-D interface with isdn4linux + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. - */ - -/* - * PCBIT-D interface with isdn4linux + * the GNU General Public License, incorporated herein by reference. */ /* @@ -412,7 +410,6 @@ return len; } - int pcbit_writecmd(const u_char* buf, int len, int user, int driver, int channel) { struct pcbit_dev * dev; @@ -436,32 +433,36 @@ if (len > BANK4 + 1) { printk("pcbit_writecmd: invalid length %d\n", len); - return -EFAULT; + return -EINVAL; } if (user) { - u_char cbuf[1024]; + u_char *cbuf = kmalloc(len, GFP_KERNEL); + if (!cbuf) + return -ENOMEM; - copy_from_user(cbuf, buf, len); - for (i=0; i<len; i++) - writeb(cbuf[i], dev->sh_mem + i); + if (copy_from_user(cbuf, buf, len)) { + kfree(cbuf); + return -EFAULT; + } + memcpy_toio(dev->sh_mem, cbuf, len); + kfree(cbuf); } else memcpy_toio(dev->sh_mem, buf, len); return len; - break; case L2_FWMODE: /* this is the hard part */ /* dumb board */ - if (len < 0) - return -EINVAL; - if (user) { /* get it into kernel space */ if ((ptr = kmalloc(len, GFP_KERNEL))==NULL) return -ENOMEM; - copy_from_user(ptr, buf, len); + if (copy_from_user(ptr, buf, len)) { + kfree(ptr); + return -EFAULT; + } loadbuf = ptr; } else @@ -493,12 +494,9 @@ kfree(ptr); return errstat ? errstat : len; - - break; default: return -EBUSY; } - return 0; } /* Index: edss1.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/edss1.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- edss1.c 25 Feb 2001 23:15:09 -0000 1.1.1.2 +++ edss1.c 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,25 +1,19 @@ /* + * DSS.1 Finite State Machine + * base: ITU-T Rec Q.931 + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. - */ - -/* - * DSS.1 Finite State Machine - * base: ITU-T Rec Q.931 + * the GNU General Public License, incorporated herein by reference. */ /* * TODO: complete the FSM * move state/event descriptions to a user space logger */ - -#define __NO_VERSION__ - -#include <linux/module.h> #include <linux/sched.h> #include <linux/string.h> Index: edss1.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/edss1.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- edss1.h 14 Jan 2001 18:40:08 -0000 1.1.1.1 +++ edss1.h 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,14 +1,12 @@ /* + * DSS.1 module definitions + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. - */ - -/* - * DSS.1 module definitions + * the GNU General Public License, incorporated herein by reference. */ #ifndef EDSS1_H Index: layer2.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/layer2.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- layer2.c 25 Feb 2001 23:15:09 -0000 1.1.1.2 +++ layer2.c 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,10 +1,12 @@ /* + * PCBIT-D low-layer interface + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* @@ -13,10 +15,6 @@ */ /* - * PCBIT-D low-layer interface - */ - -/* * Based on documentation provided by Inesc: * - "Interface com bus do PC para o PCBIT e PCBIT-D", Inesc, Jan 93 */ @@ -26,16 +24,6 @@ * re-write/remove debug printks */ -#define __NO_VERSION__ - - -#ifdef MODULE -#define INCLUDE_INLINE_FUNCS -#endif - - -#include <linux/module.h> - #include <linux/sched.h> #include <linux/string.h> #include <linux/kernel.h> @@ -176,7 +164,6 @@ struct frame_buf *frame = NULL; unsigned char unacked; int flen; /* fragment frame length including all headers */ - int totlen; /* non-fragmented frame length */ int free; int count, cp_len; @@ -213,11 +200,12 @@ ulong msg; if (frame->skb) - totlen = FRAME_HDR_LEN + PREHDR_LEN + frame->skb->len; + flen = FRAME_HDR_LEN + PREHDR_LEN + frame->skb->len; else - totlen = FRAME_HDR_LEN + PREHDR_LEN; + flen = FRAME_HDR_LEN + PREHDR_LEN; - flen = MIN(totlen, free); + if (flen > free) + flen = free; msg = frame->msg; @@ -259,9 +247,10 @@ } else { /* Type 1 frame */ - totlen = 2 + (frame->skb->len - frame->copied); + flen = 2 + (frame->skb->len - frame->copied); - flen = MIN(totlen, free); + if (flen > free) + flen = free; /* TT */ tt = ((ushort) (flen - 2)) | 0x8000U; /* Type 1 */ @@ -271,8 +260,9 @@ } if (frame->skb) { - cp_len = MIN(frame->skb->len - frame->copied, - flen - count); + cp_len = frame->skb->len - frame->copied; + if (cp_len > flen - count) + cp_len = flen - count; memcpy_topcbit(dev, frame->skb->data + frame->copied, cp_len); Index: layer2.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/layer2.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- layer2.h 14 Jan 2001 18:40:09 -0000 1.1.1.1 +++ layer2.h 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,10 +1,12 @@ /* + * PCBIT-D low-layer interface definitions + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. + * the GNU General Public License, incorporated herein by reference. */ /* @@ -12,10 +14,6 @@ * Hacked to compile with egcs and run with current version of isdn modules */ -/* - * PCBIT-D low-layer interface definitions - */ - #ifndef LAYER2_H #define LAYER2_H @@ -120,8 +118,6 @@ unsigned int copied; struct frame_buf * next; }; - -#define MIN(a,b) ((a<b)?a:b) extern int pcbit_l2_write(struct pcbit_dev * dev, ulong msg, ushort refnum, struct sk_buff *skb, unsigned short hdr_len); Index: module.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/module.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- module.c 14 Jan 2001 18:40:02 -0000 1.1.1.1 +++ module.c 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,18 +1,16 @@ /* + * PCBIT-D module support + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. - */ - -/* - * PCBIT-D module support + * the GNU General Public License, incorporated herein by reference. */ #include <linux/module.h> - +#include <linux/init.h> #include <linux/sched.h> #include <linux/string.h> #include <linux/kernel.h> @@ -22,25 +20,22 @@ #include <linux/isdnif.h> #include "pcbit.h" +MODULE_DESCRIPTION("ISDN4Linux: Driver for PCBIT-T card"); +MODULE_AUTHOR("Pedro Roque Marques"); +MODULE_LICENSE("GPL"); +MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); +MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); + static int mem[MAX_PCBIT_CARDS] = {0, }; static int irq[MAX_PCBIT_CARDS] = {0, }; static int num_boards; -struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS] = {0, 0, 0, 0}; - -int init_module(void); -void cleanup_module(void); +struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS] = {0, }; extern void pcbit_terminate(int board); extern int pcbit_init_dev(int board, int mem_base, int irq); -#ifdef MODULE -MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); -MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); -#define pcbit_init init_module -#endif - -int pcbit_init(void) +static int __init pcbit_init(void) { int board; @@ -83,15 +78,10 @@ else return -EIO; } - - /* No symbols to export, hide all symbols */ - EXPORT_NO_SYMBOLS; - return 0; } -#ifdef MODULE -void cleanup_module(void) +static void __exit pcbit_exit(void) { int board; @@ -101,9 +91,8 @@ "PCBIT-D module unloaded\n"); } -#else +#ifndef MODULE #define MAX_PARA (MAX_PCBIT_CARDS * 2) -#include <linux/init.h> static int __init pcbit_setup(char *line) { int i, j, argc; @@ -134,5 +123,6 @@ __setup("pcbit=", pcbit_setup); #endif - +module_init(pcbit_init); +module_exit(pcbit_exit); Index: pcbit.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/pcbit/pcbit.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- pcbit.h 14 Jan 2001 18:40:09 -0000 1.1.1.1 +++ pcbit.h 10 Apr 2002 15:32:27 -0000 1.2 @@ -1,14 +1,12 @@ /* + * PCBIT-D device driver definitions + * * Copyright (C) 1996 Universidade de Lisboa * * Written by Pedro Roque Marques (ro...@di...) * * This software may be used and distributed according to the terms of - * the GNU Public License, incorporated herein by reference. - */ - -/* - * PCBIT-D device driver definitions + * the GNU General Public License, incorporated herein by reference. */ #ifndef PCBIT_H |
From: Andy P. <at...@us...> - 2002-04-10 18:30:44
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot In directory usw-pr-cvs1:/tmp/cvs-serv25860/ppc/boot Modified Files: Makefile Removed Files: head.S iso_font.h kbd.c misc.c mkprep.c ns16550.c ns16550.h of1275.c of1275.h offset size vreset.c Log Message: synch 2.4.15 commit 43 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/boot/Makefile,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- Makefile 25 Feb 2001 23:15:18 -0000 1.1.1.2 +++ Makefile 10 Apr 2002 15:03:56 -0000 1.2 @@ -9,127 +9,78 @@ # Adapted for PowerPC by Gary Thomas # modified by Cort (co...@cs...) # -.c.s: - $(CC) $(CFLAGS) -S -o $*.s $< -.s.o: - $(AS) -o $*.o $< -.c.o: - $(CC) $(CFLAGS) -DINITRD_OFFSET=$(IOFF) -DINITRD_SIZE=$(ISZ) -DZIMAGE_OFFSET=$(ZOFF) -DZIMAGE_SIZE=$(ZSZ) -D__BOOTER__ -c -o $*.o $< -.S.s: - $(CPP) $(AFLAGS) -traditional -o $*.o $< -.S.o: - $(CC) $(AFLAGS) -traditional -c -o $*.o $< - -ZOFF = 0 -ZSZ = 0 -IOFF = 0 -ISZ = 0 + +GZIP_FLAGS = -v9f + +CFLAGS += -fno-builtin -D__BOOTER__ -I$(TOPDIR)/arch/$(ARCH)/boot/include + +AFLAGS += -D__BOOTER__ +OBJCOPY_ARGS = -O elf32-powerpc ifeq ($(CONFIG_SMP),y) -TFTPIMAGE=/tftpboot/zImage.prep.smp$(MSIZE) +TFTPSIMAGE=/tftpboot/sImage.smp else -TFTPIMAGE=/tftpboot/zImage.prep$(MSIZE) +TFTPSIMAGE=/tftpboot/sImage endif -ifeq ($(CONFIG_PPC64BRIDGE),y) -MSIZE=.64 -else -MSIZE= -endif +lib/zlib.a: + $(MAKE) -C lib -ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00800000 +images/vmlinux.gz: $(TOPDIR)/vmlinux + $(MAKE) -C images vmlinux.gz -GZIP_FLAGS = -v9f +# Subdirs and tools needed for each. +subdir-y := lib images common +subdir-$(CONFIG_ALL_PPC) += chrp pmac prep +tools-$(CONFIG_ALL_PPC) := addnote piggyback mknote hack-coff mkprep +subdir-$(CONFIG_4xx) += tree +subdir-$(CONFIG_8xx) += mbx +subdir-$(CONFIG_8260) += mbx +tools-$(CONFIG_GEMINI) := mksimage -OBJECTS := head.o misc.o ../coffboot/zlib.o -CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS -fno-builtin -OBJCOPY_ARGS = -O elf32-powerpc +# These are dirs we don't want to go into on BOOT_TARGETS +NONBOOT := lib images common -OBJECTS += vreset.o kbd.o of1275.o -ifeq ($(CONFIG_SERIAL_CONSOLE),y) -OBJECTS += ns16550.o -endif - -all: zImage - -zvmlinux.initrd: zvmlinux - $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=initrd=ramdisk.image.gz \ - --add-section=image=../coffboot/vmlinux.gz \ - zvmlinux.initrd.tmp zvmlinux.initrd - $(CC) $(CFLAGS) -DINITRD_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd initrd` \ - -DINITRD_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd initrd` \ - -DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd image` \ - -DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd image` \ - -D__BOOTER__ \ - -c -o misc.o misc.c - $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ - --add-section=initrd=ramdisk.image.gz \ - --add-section=image=../coffboot/vmlinux.gz \ - zvmlinux.initrd.tmp $@ - rm zvmlinux.initrd.tmp - -zImage: zvmlinux mkprep -ifdef CONFIG_ALL_PPC - ./mkprep -pbp zvmlinux zImage -endif -ifdef CONFIG_APUS - $(STRIP) ../../../vmlinux -o vmapus - gzip $(GZIP_FLAGS) vmapus +# These are the subdirs we want to use +BOOTDIRS = $(filter-out $(NONBOOT), $(subdir-y)) + +# This will make the tools we need. We do it like this to ensure that we use +# HOSTCC. -- Tom +maketools: + $(MAKE) -C utils $(tools-y) + +# The targets all boards support for boot images. +BOOT_TARGETS = zImage +ifndef CONFIG_GEMINI +BOOT_TARGETS += zImage.initrd znetboot znetboot.initrd endif -zImage.initrd: zvmlinux.initrd mkprep -ifdef CONFIG_ALL_PPC - ./mkprep -pbp zvmlinux.initrd zImage.initrd -endif - -zvmlinux: $(OBJECTS) ../coffboot/vmlinux.gz -# -# build the boot loader image and then compute the offset into it -# for the kernel image -# - $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \ - zvmlinux.tmp $@ -# -# then with the offset rebuild the bootloader so we know where the kernel is -# - $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \ - -DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux image` \ - -DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux image` \ - -D__BOOTER__ \ - -c -o misc.o misc.c - $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS) - $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \ - zvmlinux.tmp $@ - rm zvmlinux.tmp +$(BOOT_TARGETS): sImage vmapus lib/zlib.a images/vmlinux.gz maketools +ifneq ($(BOOTDIRS),) + for d in $(BOOTDIRS); do $(MAKE) -C $$d $@; done +endif -floppy: $(TOPDIR)/vmlinux zImage - dd if=zImage of=/dev/fd0H1440 bs=64b +sImage: $(TOPDIR)/vmlinux +ifdef CONFIG_GEMINI + $(OBJCOPY) -I elf32-powerpc -O binary $(TOPDIR)/vmlinux images/sImage +endif -mkprep : mkprep.c - $(HOSTCC) -o mkprep mkprep.c +vmapus: $(TOPDIR)/vmlinux +ifdef CONFIG_APUS + $(STRIP) $(TOPDIR)/vmlinux -o images/vmapus + gzip $(GZIP_FLAGS) images/vmapus +endif +ifdef CONFIG_GEMINI znetboot : zImage -ifdef CONFIG_ALL_PPC - cp zImage $(TFTPIMAGE) + cp images/sImage $(TFTPSIMAGE) endif -znetboot.initrd : zImage.initrd - cp zImage.initrd $(TFTPIMAGE) - +# Clean up after ourselves. We have to do it like this since only some dirs +# need to be gone into. -- Tom clean: - rm -f vmlinux* zvmlinux* mkprep zImage* - -fastdep: - $(TOPDIR)/scripts/mkdep *.[Sch] > .depend - -dep: - $(CPP) $(CPPFLAGS) -M *.S *.c > .depend - -# just here to match coffboot/Makefile -vmlinux.coff: + $(MAKE) -C images clean + $(MAKE) -C tree clean + $(MAKE) -C utils clean -vmlinux.coff.initrd: +include $(TOPDIR)/Rules.make --- head.S DELETED --- --- iso_font.h DELETED --- --- kbd.c DELETED --- --- misc.c DELETED --- --- mkprep.c DELETED --- --- ns16550.c DELETED --- --- ns16550.h DELETED --- --- of1275.c DELETED --- --- of1275.h DELETED --- --- offset DELETED --- --- size DELETED --- --- vreset.c DELETED --- |
From: Andy P. <at...@us...> - 2002-04-10 18:30:42
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga In directory usw-pr-cvs1:/tmp/cvs-serv25860/ppc/amiga Modified Files: Makefile amiga_ksyms.c amiints.c amisound.c bootinfo.c chipram.c cia.c config.c ints.c pcmcia.c time.c Log Message: synch 2.4.15 commit 43 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:32:36 -0000 1.1.1.1 +++ Makefile 10 Apr 2002 15:03:56 -0000 1.2 @@ -1,3 +1,5 @@ +# BK Id: SCCS/s.Makefile 1.5 05/21/01 00:48:24 cort +# # # Makefile for Linux arch/m68k/amiga source directory # @@ -14,6 +16,6 @@ obj-y := config.o amiints.o cia.o time.o bootinfo.o amisound.o \ chipram.o amiga_ksyms.o -obj-$(CONFIG_AMIGA_PCMCIA) += pcmia.o +obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o include $(TOPDIR)/Rules.make Index: amiga_ksyms.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/amiga_ksyms.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- amiga_ksyms.c 14 Jan 2001 19:32:36 -0000 1.1.1.1 +++ amiga_ksyms.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1 +1,4 @@ +/* + * BK Id: SCCS/s.amiga_ksyms.c 1.5 05/17/01 18:14:20 cort + */ #include "../../m68k/amiga/amiga_ksyms.c" Index: amiints.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/amiints.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- amiints.c 25 Feb 2001 23:15:18 -0000 1.1.1.2 +++ amiints.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1,4 +1,7 @@ /* + * BK Id: SCCS/s.amiints.c 1.8 05/21/01 00:48:24 cort + */ +/* * linux/arch/m68k/amiga/amiints.c -- Amiga Linux interrupt handling code * * This file is subject to the terms and conditions of the GNU General Public @@ -255,9 +258,10 @@ return; } - if (irq >= IRQ_AMIGA_AUTO) + if (irq >= IRQ_AMIGA_AUTO) { sys_free_irq(irq - IRQ_AMIGA_AUTO, dev_id); - + return; + } if (irq >= IRQ_AMIGA_CIAA) { cia_free_irq(irq, dev_id); return; @@ -295,7 +299,10 @@ return; } - if (--ami_ablecount[irq]) + ami_ablecount[irq]--; + if (ami_ablecount[irq]<0) + ami_ablecount[irq]=0; + else if (ami_ablecount[irq]) return; /* No action for auto-vector interrupts */ @@ -347,64 +354,16 @@ ami_irq_list[irq]->handler(irq, ami_irq_list[irq]->dev_id, fp); } -void amiga_do_irq_list(int irq, struct pt_regs *fp, struct irq_server *server) +void amiga_do_irq_list(int irq, struct pt_regs *fp) { - irq_node_t *node, *slow_nodes; - unsigned short intena; - unsigned long flags; + irq_node_t *node; kstat.irqs[0][SYS_IRQS + irq]++; - if (server->count++) - server->reentrance = 1; - - intena = ami_intena_vals[irq]; - custom.intreq = intena; - /* serve first fast handlers - there can only be one of these */ - node = ami_irq_list[irq]; - - /* - * Timer interrupts show up like this - */ - if (!node) { - server->count--; - return; - } + custom.intreq = ami_intena_vals[irq]; - if (node && (node->flags & SA_INTERRUPT)) { - save_flags(flags); - cli(); + for (node = ami_irq_list[irq]; node; node = node->next) node->handler(irq, node->dev_id, fp); - restore_flags(flags); - - server->count--; - return; - } - - /* - * Disable the interrupt source in question and reenable all - * other interrupts. No interrupt handler should ever touch - * the intena flags directly! - */ - custom.intena = intena; - save_flags(flags); - sti(); - - slow_nodes = node; - for (;;) { - for (; node; node = node->next) - node->handler(irq, node->dev_id, fp); - - if (!server->reentrance) { - server->count--; - restore_flags(flags); - custom.intena = IF_SETCLR | intena; - return; - } - - server->reentrance = 0; - node = slow_nodes; - } } /* @@ -437,7 +396,6 @@ static void ami_int3(int irq, void *dev_id, struct pt_regs *fp) { unsigned short ints = custom.intreqr & custom.intenar; - static struct irq_server server = {0, 0}; /* if a blitter interrupt */ if (ints & IF_BLIT) { @@ -453,7 +411,7 @@ /* if a vertical blank interrupt */ if (ints & IF_VERTB) - amiga_do_irq_list(IRQ_AMIGA_VERTB, fp, &server); + amiga_do_irq_list(IRQ_AMIGA_VERTB, fp); } static void ami_int4(int irq, void *dev_id, struct pt_regs *fp) @@ -512,7 +470,7 @@ and executes them in a loop. Having ami_badint at the end of the chain is a bad idea. */ void (*amiga_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = { - NULL, ami_int1, NULL, NULL /* FB expects to replace ami_int3*/, + NULL, ami_int1, NULL, ami_int3, ami_int4, ami_int5, NULL, ami_int7 }; #else Index: amisound.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/amisound.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- amisound.c 14 Jan 2001 19:32:38 -0000 1.1.1.1 +++ amisound.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1 +1,4 @@ +/* + * BK Id: SCCS/s.amisound.c 1.5 05/17/01 18:14:20 cort + */ #include "../../m68k/amiga/amisound.c" Index: bootinfo.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/bootinfo.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bootinfo.c 14 Jan 2001 19:32:38 -0000 1.1.1.1 +++ bootinfo.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1,4 +1,7 @@ /* + * BK Id: SCCS/s.bootinfo.c 1.5 05/17/01 18:14:20 cort + */ +/* * linux/arch/ppc/amiga/bootinfo.c * * Extracted from arch/m68k/kernel/setup.c. Index: chipram.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/chipram.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- chipram.c 14 Jan 2001 19:32:39 -0000 1.1.1.1 +++ chipram.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1,183 +1,4 @@ /* -** linux/amiga/chipram.c -** -** Modified 03-May-94 by Geert Uytterhoeven <ge...@li...> -** - 64-bit aligned allocations for full AGA compatibility -*/ - -#include <linux/config.h> -#include <linux/types.h> -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/zorro.h> -#include <asm/amigahw.h> - -struct chip_desc { - unsigned first : 1; - unsigned last : 1; - unsigned alloced : 1; - unsigned length : 24; - long pad; /* We suppose this makes this struct 64 bits long!! */ -}; - -#define DP(ptr) ((struct chip_desc *)(ptr)) - -u_long amiga_chip_size; -static unsigned long chipavail; - -static struct resource chipram = { "Chip RAM", 0 }; - -unsigned long amiga_chip_avail( void ) -{ -#ifdef DEBUG - printk("chip_avail : %ld bytes\n",chipavail); -#endif - return chipavail; -} - - -void __init amiga_chip_init (void) -{ - struct chip_desc *dp; - - if (!AMIGAHW_PRESENT(CHIP_RAM)) - return; - -#ifndef CONFIG_APUS_FAST_EXCEPT - /* - * Remove the first 4 pages where PPC exception handlers will - * be located. - */ - amiga_chip_size -= 0x4000; -#endif - chipram.end = amiga_chip_size-1; - request_resource(&iomem_resource, &chipram); - - /* initialize start boundary */ - - dp = DP(chipaddr); - dp->first = 1; - - dp->alloced = 0; - dp->length = amiga_chip_size - 2*sizeof(*dp); - - /* initialize end boundary */ - dp = DP(chipaddr + amiga_chip_size) - 1; - dp->last = 1; - - dp->alloced = 0; - dp->length = amiga_chip_size - 2*sizeof(*dp); - chipavail = dp->length; /*MILAN*/ - -#ifdef DEBUG - printk ("chipram end boundary is %p, length is %d\n", dp, - dp->length); -#endif -} - -void *amiga_chip_alloc(long size, const char *name) -{ - /* last chunk */ - struct chip_desc *dp; - void *ptr; - - /* round off */ - size = (size + 7) & ~7; - -#ifdef DEBUG - printk("amiga_chip_alloc: allocate %ld bytes\n", size); -#endif - - /* - * get pointer to descriptor for last chunk by - * going backwards from end chunk - */ - dp = DP(chipaddr + amiga_chip_size) - 1; - dp = DP((unsigned long)dp - dp->length) - 1; - - while ((dp->alloced || dp->length < size) - && !dp->first) - dp = DP ((unsigned long)dp - dp[-1].length) - 2; - - if (dp->alloced || dp->length < size) { - printk ("no chipmem available for %ld allocation\n", size); - return NULL; - } - - if (dp->length < (size + 2*sizeof(*dp))) { - /* length too small to split; allocate the whole thing */ - dp->alloced = 1; - ptr = (void *)(dp+1); - dp = DP((unsigned long)ptr + dp->length); - dp->alloced = 1; -#ifdef DEBUG - printk ("amiga_chip_alloc: no split\n"); -#endif - } else { - /* split the extent; use the end part */ - long newsize = dp->length - (2*sizeof(*dp) + size); - -#ifdef DEBUG - printk ("amiga_chip_alloc: splitting %d to %ld\n", dp->length, - newsize); -#endif - dp->length = newsize; - dp = DP((unsigned long)(dp+1) + newsize); - dp->first = dp->last = 0; - dp->alloced = 0; - dp->length = newsize; - dp++; - dp->first = dp->last = 0; - dp->alloced = 1; - dp->length = size; - ptr = (void *)(dp+1); - dp = DP((unsigned long)ptr + size); - dp->alloced = 1; - dp->length = size; - } - -#ifdef DEBUG - printk ("amiga_chip_alloc: returning %p\n", ptr); -#endif - - if ((unsigned long)ptr & 7) - panic("amiga_chip_alloc: alignment violation\n"); - - chipavail -= size + (2*sizeof(*dp)); /*MILAN*/ - - if (!request_mem_region(ZTWO_PADDR(ptr), size, name)) - printk(KERN_WARNING "amiga_chip_alloc: region of size %ld at 0x%08lx " - "is busy\n", size, ZTWO_PADDR(ptr)); - - return ptr; -} - -void amiga_chip_free (void *ptr) -{ - struct chip_desc *sdp = DP(ptr) - 1, *dp2; - struct chip_desc *edp = DP((unsigned long)ptr + sdp->length); - - chipavail += sdp->length + (2* sizeof(sdp)); /*MILAN*/ -#ifdef DEBUG - printk("chip_free: free %ld bytes at %p\n",sdp->length,ptr); -#endif - /* deallocate the chunk */ - sdp->alloced = edp->alloced = 0; - release_mem_region(ZTWO_PADDR(ptr), sdp->length); - - /* check if we should merge with the previous chunk */ - if (!sdp->first && !sdp[-1].alloced) { - dp2 = DP((unsigned long)sdp - sdp[-1].length) - 2; - dp2->length += sdp->length + 2*sizeof(*sdp); - edp->length = dp2->length; - sdp = dp2; - } - - /* check if we should merge with the following chunk */ - if (!edp->last && !edp[1].alloced) { - dp2 = DP((unsigned long)edp + edp[1].length) + 2; - dp2->length += edp->length + 2*sizeof(*sdp); - sdp->length = dp2->length; - edp = dp2; - } -} + * BK Id: SCCS/s.chipram.c 1.7 05/21/01 00:49:49 cort + */ +#include "../../m68k/amiga/chipram.c" Index: cia.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/cia.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- cia.c 14 Jan 2001 19:32:39 -0000 1.1.1.1 +++ cia.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1,4 +1,7 @@ /* + * BK Id: SCCS/s.cia.c 1.7 05/21/01 00:48:24 cort + */ +/* * linux/arch/m68k/amiga/cia.c - CIA support * * Copyright (C) 1996 Roman Zippel @@ -27,18 +30,17 @@ u_short int_mask; int handler_irq, cia_irq, server_irq; char *name; - struct irq_server server; irq_handler_t irq_list[CIA_IRQS]; } ciaa_base = { &ciaa, 0, 0, IF_PORTS, IRQ_AMIGA_AUTO_2, IRQ_AMIGA_CIAA, IRQ_AMIGA_PORTS, - "CIAA handler", {0, 0} + "CIAA handler" }, ciab_base = { &ciab, 0, 0, IF_EXTER, IRQ_AMIGA_AUTO_6, IRQ_AMIGA_CIAB, IRQ_AMIGA_EXTER, - "CIAB handler", {0, 0} + "CIAB handler" }; #define CIA_SET_BASE_ADJUST_IRQ(base, irq) \ @@ -197,7 +199,7 @@ } ints >>= 1; } - amiga_do_irq_list(base->server_irq, fp, &base->server); + amiga_do_irq_list(base->server_irq, fp); } void __init cia_init_IRQ(struct ciabase *base) Index: config.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/config.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- config.c 14 Jan 2001 19:32:43 -0000 1.1.1.1 +++ config.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1,12 +1,8 @@ +/* + * BK Id: SCCS/s.config.c 1.12 09/18/01 11:19:06 paulus + */ #define m68k_debug_device debug_device -#include <linux/init.h> - -/* machine dependent "kbd-reset" setup function */ -void (*mach_kbd_reset_setup) (char *, int) __initdata = 0; - -#include <asm/io.h> - /* * linux/arch/m68k/amiga/config.c * @@ -28,6 +24,10 @@ #include <linux/kd.h> #include <linux/tty.h> #include <linux/console.h> +#include <linux/init.h> +#ifdef CONFIG_ZORRO +#include <linux/zorro.h> +#endif #include <asm/bootinfo.h> #include <asm/setup.h> @@ -36,10 +36,12 @@ #include <asm/amigahw.h> #include <asm/amigaints.h> #include <asm/irq.h> +#include <asm/keyboard.h> #include <asm/machdep.h> -#include <linux/zorro.h> +#include <asm/io.h> unsigned long powerup_PCI_present; +unsigned long powerup_BPPCPLUS_present; unsigned long amiga_model; unsigned long amiga_eclock; unsigned long amiga_masterclock; @@ -49,22 +51,22 @@ unsigned char amiga_psfreq; struct amiga_hw_present amiga_hw_present; -static const char s_a500[] __initdata = "A500"; -static const char s_a500p[] __initdata = "A500+"; -static const char s_a600[] __initdata = "A600"; -static const char s_a1000[] __initdata = "A1000"; -static const char s_a1200[] __initdata = "A1200"; -static const char s_a2000[] __initdata = "A2000"; -static const char s_a2500[] __initdata = "A2500"; -static const char s_a3000[] __initdata = "A3000"; -static const char s_a3000t[] __initdata = "A3000T"; -static const char s_a3000p[] __initdata = "A3000+"; -static const char s_a4000[] __initdata = "A4000"; -static const char s_a4000t[] __initdata = "A4000T"; -static const char s_cdtv[] __initdata = "CDTV"; -static const char s_cd32[] __initdata = "CD32"; -static const char s_draco[] __initdata = "Draco"; -static const char *amiga_models[] __initdata = { +static char s_a500[] __initdata = "A500"; +static char s_a500p[] __initdata = "A500+"; +static char s_a600[] __initdata = "A600"; +static char s_a1000[] __initdata = "A1000"; +static char s_a1200[] __initdata = "A1200"; +static char s_a2000[] __initdata = "A2000"; +static char s_a2500[] __initdata = "A2500"; +static char s_a3000[] __initdata = "A3000"; +static char s_a3000t[] __initdata = "A3000T"; +static char s_a3000p[] __initdata = "A3000+"; +static char s_a4000[] __initdata = "A4000"; +static char s_a4000t[] __initdata = "A4000T"; +static char s_cdtv[] __initdata = "CDTV"; +static char s_cd32[] __initdata = "CD32"; +static char s_draco[] __initdata = "Draco"; +static char *amiga_models[] __initdata = { s_a500, s_a500p, s_a600, s_a1000, s_a1200, s_a2000, s_a2500, s_a3000, s_a3000t, s_a3000p, s_a4000, s_a4000t, s_cdtv, s_cd32, s_draco, }; @@ -121,7 +123,7 @@ }; #ifdef CONFIG_MAGIC_SYSRQ -static char amiga_sysrq_xlate[128] = +char amiga_sysrq_xlate[128] = "\0001234567890-=\\\000\000" /* 0x00 - 0x0f */ "qwertyuiop[]\000123" /* 0x10 - 0x1f */ "asdfghjkl;'\000\000456" /* 0x20 - 0x2f */ @@ -139,16 +141,18 @@ * Motherboard Resources present in all Amiga models */ -static struct resource mb_res[] = { - { "Ranger Memory", 0x00c00000, 0x00c7ffff }, - { "CIA B", 0x00bfd000, 0x00bfdfff }, - { "CIA A", 0x00bfe000, 0x00bfefff }, - { "Custom I/O", 0x00dff000, 0x00dfffff }, - { "Kickstart ROM", 0x00f80000, 0x00ffffff } +static struct { + struct resource _ciab, _ciaa, _custom, _kickstart; +} mb_resources = { +// { "Ranger Memory", 0x00c00000, 0x00c7ffff }, + _ciab: { "CIA B", 0x00bfd000, 0x00bfdfff }, + _ciaa: { "CIA A", 0x00bfe000, 0x00bfefff }, + _custom: { "Custom I/O", 0x00dff000, 0x00dfffff }, + _kickstart: { "Kickstart ROM", 0x00f80000, 0x00ffffff } }; static struct resource rtc_resource = { - "A2000 RTC", 0x00dc0000, 0x00dcffff + NULL, 0x00dc0000, 0x00dcffff }; static struct resource ram_resource[NUM_MEMINFO]; @@ -194,6 +198,7 @@ break; case BI_AMIGA_AUTOCON: +#ifdef CONFIG_ZORRO if (zorro_num_autocon < ZORRO_NUM_AUTO) { const struct ConfigDev *cd = (struct ConfigDev *)data; struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon++]; @@ -204,12 +209,21 @@ dev->resource.end = dev->resource.start+cd->cd_BoardSize-1; } else printk("amiga_parse_bootinfo: too many AutoConfig devices\n"); +#endif /* CONFIG_ZORRO */ break; case BI_AMIGA_SERPER: /* serial port period: ignored here */ break; + case BI_AMIGA_PUP_BRIDGE: + powerup_PCI_present = *(const unsigned short *)data; + break; + + case BI_AMIGA_BPPC_SCSI: + powerup_BPPCPLUS_present = *(const unsigned short *)data; + break; + default: unknown = 1; } @@ -392,11 +406,8 @@ /* Some APUS boxes may have PCI memory, but ... */ iomem_resource.name = "Memory"; - request_resource(&iomem_resource, &ranger_resource); - request_resource(&iomem_resource, &ciab_resource); - request_resource(&iomem_resource, &ciaa_resource); - request_resource(&iomem_resource, &custom_chips_resource); - request_resource(&iomem_resource, &kickstart_resource); + for (i = 0; i < 4; i++) + request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]); mach_sched_init = amiga_sched_init; mach_keyb_init = amiga_keyb_init; @@ -415,11 +426,12 @@ mach_gettimeoffset = amiga_gettimeoffset; if (AMIGAHW_PRESENT(A3000_CLK)){ mach_gettod = a3000_gettod; - rtc_resource.name[1] = '3'; + rtc_resource.name = "A3000 RTC"; request_resource(&iomem_resource, &rtc_resource); } else{ /* if (AMIGAHW_PRESENT(A2000_CLK)) */ mach_gettod = a2000_gettod; + rtc_resource.name = "A2000 RTC"; request_resource(&iomem_resource, &rtc_resource); } @@ -439,14 +451,10 @@ mach_floppy_setup = amiga_floppy_setup; #endif mach_reset = amiga_reset; +#ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; - kd_mksound = amiga_mksound; -#ifdef CONFIG_MAGIC_SYSRQ - mach_sysrq_key = 0x5f; /* HELP */ - mach_sysrq_shift_state = 0x03; /* SHIFT+ALTGR */ - mach_sysrq_shift_mask = 0xff; /* all modifiers except CapsLock */ - mach_sysrq_xlate = amiga_sysrq_xlate; #endif + kd_mksound = amiga_mksound; #ifdef CONFIG_HEARTBEAT mach_heartbeat = amiga_heartbeat; #endif @@ -500,11 +508,14 @@ static unsigned short jiffy_ticks; static void __init amiga_sched_init(void (*timer_routine)(int, void *, - struct pt_regs *)) + struct pt_regs *)) { + static struct resource sched_res = { + "timer", 0x00bfd400, 0x00bfd5ff, + }; jiffy_ticks = (amiga_eclock+HZ/2)/HZ; - if (!request_mem_region(CIAB_PHYSADDR+0x400, 0x200, "timer")) + if (request_resource(&mb_resources._ciab, &sched_res)) printk("Cannot allocate ciab.ta{lo,hi}\n"); ciab.cra &= 0xC0; /* turn off timer A, continuous mode, from Eclk */ ciab.talo = jiffy_ticks % 256; @@ -612,6 +623,8 @@ t->wday = tod->weekday; t->mon = tod->month1 * 10 + tod->month2 - 1; t->year = tod->year1 * 10 + tod->year2; + if (t->year <= 69) + t->year += 100; } else { tod->second1 = t->sec / 10; tod->second2 = t->sec % 10; @@ -625,6 +638,8 @@ tod->weekday = t->wday; tod->month1 = (t->mon + 1) / 10; tod->month2 = (t->mon + 1) % 10; + if (t->year >= 100) + t->year -= 100; tod->year1 = t->year / 10; tod->year2 = t->year % 10; } @@ -646,6 +661,8 @@ t->wday = tod->weekday; t->mon = tod->month1 * 10 + tod->month2 - 1; t->year = tod->year1 * 10 + tod->year2; + if (t->year <= 69) + t->year += 100; if (!(tod->cntrl3 & TOD2000_CNTRL3_24HMODE)){ if (!(tod->hour1 & TOD2000_HOUR1_PM) && t->hour == 12) @@ -672,6 +689,8 @@ tod->weekday = t->wday; tod->month1 = (t->mon + 1) / 10; tod->month2 = (t->mon + 1) % 10; + if (t->year >= 100) + t->year -= 100; tod->year1 = t->year / 10; tod->year2 = t->year % 10; } @@ -743,20 +762,6 @@ return 0; } -void dbprintf(const char *fmt , ...) -{ - static char buf[1024]; - va_list args; - extern void console_print (const char *str); - extern int vsprintf(char * buf, const char * fmt, va_list args); - - va_start(args, fmt); - vsprintf(buf, fmt, args); - va_end(args); - - console_print (buf); -} - static NORET_TYPE void amiga_reset( void ) ATTRIB_NORET; @@ -796,7 +801,9 @@ static void amiga_savekmsg_init(void) { - savekmsg = (struct savekmsg *)amiga_chip_alloc(SAVEKMSG_MAXMEM, "Debug"); + static struct resource debug_res = { "Debug" }; + + savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res); savekmsg->magic1 = SAVEKMSG_MAGIC1; savekmsg->magic2 = SAVEKMSG_MAGIC2; savekmsg->magicptr = virt_to_phys(savekmsg); Index: ints.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/ints.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ints.c 14 Jan 2001 19:32:44 -0000 1.1.1.1 +++ ints.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1,4 +1,7 @@ /* + * BK Id: SCCS/s.ints.c 1.5 05/17/01 18:14:20 cort + */ +/* * linux/arch/ppc/amiga/ints.c * * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c Index: pcmcia.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/pcmcia.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- pcmcia.c 14 Jan 2001 19:32:44 -0000 1.1.1.1 +++ pcmcia.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1 +1,4 @@ +/* + * BK Id: SCCS/s.pcmcia.c 1.5 05/17/01 18:14:20 cort + */ #include "../../m68k/amiga/pcmcia.c" Index: time.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/amiga/time.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- time.c 14 Jan 2001 19:32:44 -0000 1.1.1.1 +++ time.c 10 Apr 2002 15:03:56 -0000 1.2 @@ -1,3 +1,6 @@ +/* + * BK Id: SCCS/s.time.c 1.5 05/17/01 18:14:20 cort + */ #include <linux/config.h> /* CONFIG_HEARTBEAT */ #include <linux/errno.h> #include <linux/sched.h> |
From: Andy P. <at...@us...> - 2002-04-09 17:08:31
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/telephony In directory usw-pr-cvs1:/tmp/cvs-serv6177/telephony Modified Files: Config.in Makefile ixj.c ixj.h phonedev.c Added Files: ixj-ver.h ixj_pcmcia.c Log Message: synch 2.4.15 commit 27 --- NEW FILE --- /* configuration management identifiers */ #define IXJ_VER_MAJOR 1 #define IXJ_VER_MINOR 0 #define IXJ_BLD_VER 1 --- NEW FILE --- #include "ixj-ver.h" #include <linux/module.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/kernel.h> /* printk() */ #include <linux/fs.h> /* everything... */ #include <linux/errno.h> /* error codes */ #include <linux/slab.h> #include <pcmcia/version.h> #include <pcmcia/cs_types.h> #include <pcmcia/cs.h> #include <pcmcia/cistpl.h> #include <pcmcia/ds.h> #include "ixj.h" /* * PCMCIA service support for Quicknet cards */ #ifdef PCMCIA_DEBUG static int pc_debug = PCMCIA_DEBUG; MODULE_PARM(pc_debug, "i"); #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) #else #define DEBUG(n, args...) #endif typedef struct ixj_info_t { int ndev; dev_node_t node; struct ixj *port; } ixj_info_t; static dev_link_t *ixj_attach(void); static void ixj_detach(dev_link_t *); static void ixj_config(dev_link_t * link); static void ixj_cs_release(u_long arg); static int ixj_event(event_t event, int priority, event_callback_args_t * args); static dev_info_t dev_info = "ixj_cs"; static dev_link_t *dev_list = NULL; static void cs_error(client_handle_t handle, int func, int ret) { error_info_t err = { func, ret }; CardServices(ReportError, handle, &err); } static dev_link_t *ixj_attach(void) { client_reg_t client_reg; dev_link_t *link; int ret; DEBUG(0, "ixj_attach()\n"); /* Create new ixj device */ link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); if (!link) return NULL; memset(link, 0, sizeof(struct dev_link_t)); link->release.function = &ixj_cs_release; link->release.data = (u_long) link; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; link->io.IOAddrLines = 3; link->conf.Vcc = 50; link->conf.IntType = INT_MEMORY_AND_IO; link->priv = kmalloc(sizeof(struct ixj_info_t), GFP_KERNEL); if (!link->priv) return NULL; memset(link->priv, 0, sizeof(struct ixj_info_t)); /* Register with Card Services */ link->next = dev_list; dev_list = link; client_reg.dev_info = &dev_info; client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; client_reg.event_handler = &ixj_event; client_reg.Version = 0x0210; client_reg.event_callback_args.client_data = link; ret = CardServices(RegisterClient, &link->handle, &client_reg); if (ret != CS_SUCCESS) { cs_error(link->handle, RegisterClient, ret); ixj_detach(link); return NULL; } return link; } static void ixj_detach(dev_link_t * link) { dev_link_t **linkp; long flags; int ret; DEBUG(0, "ixj_detach(0x%p)\n", link); for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) if (*linkp == link) break; if (*linkp == NULL) return; save_flags(flags); cli(); if (link->state & DEV_RELEASE_PENDING) { del_timer(&link->release); link->state &= ~DEV_RELEASE_PENDING; } restore_flags(flags); if (link->state & DEV_CONFIG) ixj_cs_release((u_long) link); if (link->handle) { ret = CardServices(DeregisterClient, link->handle); if (ret != CS_SUCCESS) cs_error(link->handle, DeregisterClient, ret); } /* Unlink device structure, free bits */ *linkp = link->next; kfree(link->priv); kfree(link); } #define CS_CHECK(fn, args...) \ while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed #define CFG_CHECK(fn, args...) \ if (CardServices(fn, args) != 0) goto next_entry static void ixj_get_serial(dev_link_t * link, IXJ * j) { client_handle_t handle; tuple_t tuple; u_short buf[128]; char *str; int last_ret, last_fn, i, place; handle = link->handle; DEBUG(0, "ixj_get_serial(0x%p)\n", link); tuple.TupleData = (cisdata_t *) buf; tuple.TupleOffset = 0; tuple.TupleDataMax = 80; tuple.Attributes = 0; tuple.DesiredTuple = CISTPL_VERS_1; CS_CHECK(GetFirstTuple, handle, &tuple); CS_CHECK(GetTupleData, handle, &tuple); str = (char *) buf; printk("PCMCIA Version %d.%d\n", str[0], str[1]); str += 2; printk("%s", str); str = str + strlen(str) + 1; printk(" %s", str); str = str + strlen(str) + 1; place = 1; for (i = strlen(str) - 1; i >= 0; i--) { switch (str[i]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': j->serial += (str[i] - 48) * place; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': j->serial += (str[i] - 55) * place; break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': j->serial += (str[i] - 87) * place; break; } place = place * 0x10; } str = str + strlen(str) + 1; printk(" version %s\n", str); cs_failed: return; } static void ixj_config(dev_link_t * link) { IXJ *j; client_handle_t handle; ixj_info_t *info; tuple_t tuple; u_short buf[128]; cisparse_t parse; config_info_t conf; cistpl_cftable_entry_t *cfg = &parse.cftable_entry; cistpl_cftable_entry_t dflt = { 0 }; int last_ret, last_fn; handle = link->handle; info = link->priv; DEBUG(0, "ixj_config(0x%p)\n", link); tuple.TupleData = (cisdata_t *) buf; tuple.TupleOffset = 0; tuple.TupleDataMax = 255; tuple.Attributes = 0; tuple.DesiredTuple = CISTPL_CONFIG; CS_CHECK(GetFirstTuple, handle, &tuple); CS_CHECK(GetTupleData, handle, &tuple); CS_CHECK(ParseTuple, handle, &tuple, &parse); link->conf.ConfigBase = parse.config.base; link->conf.Present = parse.config.rmask[0]; link->state |= DEV_CONFIG; CS_CHECK(GetConfigurationInfo, handle, &conf); tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; tuple.Attributes = 0; CS_CHECK(GetFirstTuple, handle, &tuple); while (1) { CFG_CHECK(GetTupleData, handle, &tuple); CFG_CHECK(ParseTuple, handle, &tuple, &parse); if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; link->conf.ConfigIndex = cfg->index; link->io.BasePort1 = io->win[0].base; link->io.NumPorts1 = io->win[0].len; if (io->nwin == 2) { link->io.BasePort2 = io->win[1].base; link->io.NumPorts2 = io->win[1].len; } CFG_CHECK(RequestIO, link->handle, &link->io); /* If we've got this far, we're done */ break; } next_entry: if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; CS_CHECK(GetNextTuple, handle, &tuple); } CS_CHECK(RequestConfiguration, handle, &link->conf); /* * Register the card with the core. */ j=ixj_pcmcia_probe(link->io.BasePort1,link->io.BasePort1 + 0x10); info->ndev = 1; info->node.major = PHONE_MAJOR; link->dev = &info->node; ixj_get_serial(link, j); link->state &= ~DEV_CONFIG_PENDING; return; cs_failed: cs_error(link->handle, last_fn, last_ret); ixj_cs_release((u_long) link); } static void ixj_cs_release(u_long arg) { dev_link_t *link = (dev_link_t *) arg; ixj_info_t *info = link->priv; DEBUG(0, "ixj_cs_release(0x%p)\n", link); info->ndev = 0; link->dev = NULL; CardServices(ReleaseConfiguration, link->handle); CardServices(ReleaseIO, link->handle, &link->io); link->state &= ~DEV_CONFIG; } static int ixj_event(event_t event, int priority, event_callback_args_t * args) { dev_link_t *link = args->client_data; DEBUG(1, "ixj_event(0x%06x)\n", event); switch (event) { case CS_EVENT_CARD_REMOVAL: link->state &= ~DEV_PRESENT; if (link->state & DEV_CONFIG) { link->release.expires = jiffies + (HZ / 20); link->state |= DEV_RELEASE_PENDING; add_timer(&link->release); } break; case CS_EVENT_CARD_INSERTION: link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; ixj_config(link); break; case CS_EVENT_PM_SUSPEND: link->state |= DEV_SUSPEND; /* Fall through... */ case CS_EVENT_RESET_PHYSICAL: if (link->state & DEV_CONFIG) CardServices(ReleaseConfiguration, link->handle); break; case CS_EVENT_PM_RESUME: link->state &= ~DEV_SUSPEND; /* Fall through... */ case CS_EVENT_CARD_RESET: if (DEV_OK(link)) CardServices(RequestConfiguration, link->handle, &link->conf); break; } return 0; } int __init ixj_register_pcmcia(void) { servinfo_t serv; DEBUG(0, "%s\n", version); CardServices(GetCardServicesInfo, &serv); if (serv.Revision != CS_RELEASE_CODE) { printk(KERN_NOTICE "ixj_cs: Card Services release does not match!\n"); return -EINVAL; } register_pcmcia_driver(&dev_info, &ixj_attach, &ixj_detach); return 0; } static void ixj_pcmcia_unload(void) { DEBUG(0, "ixj_cs: unloading\n"); unregister_pcmcia_driver(&dev_info); while (dev_list != NULL) ixj_detach(dev_list); } module_init(ixj_register_pcmcia); module_exit(ixj_pcmcia_unload); MODULE_LICENSE("GPL"); Index: Config.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/telephony/Config.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Config.in 14 Jan 2001 19:10:06 -0000 1.1.1.1 +++ Config.in 9 Apr 2002 16:45:53 -0000 1.2 @@ -6,4 +6,5 @@ tristate 'Linux telephony support' CONFIG_PHONE dep_tristate 'QuickNet Internet LineJack/PhoneJack support' CONFIG_PHONE_IXJ $CONFIG_PHONE +dep_tristate 'QuickNet Internet LineJack/PhoneJack PCMCIA support' CONFIG_PHONE_IXJ_PCMCIA $CONFIG_PHONE_IXJ endmenu Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/telephony/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:10:06 -0000 1.1.1.1 +++ Makefile 9 Apr 2002 16:45:53 -0000 1.2 @@ -10,10 +10,11 @@ obj-n := obj-m := obj- := -export-objs := phonedev.o +export-objs := phonedev.o ixj.o obj-$(CONFIG_PHONE) += phonedev.o obj-$(CONFIG_PHONE_IXJ) += ixj.o +obj-$(CONFIG_PHONE_IXJ_PCMCIA) += ixj_pcmcia.o O_TARGET := telephony.o Index: ixj.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/telephony/ixj.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- ixj.c 25 Feb 2001 23:15:14 -0000 1.1.1.2 +++ ixj.c 9 Apr 2002 16:45:53 -0000 1.2 @@ -1,10 +1,12 @@ /**************************************************************************** * ixj.c * - * Device Driver for the Internet PhoneJACK and - * Internet LineJACK Telephony Cards. + * Device Driver for Quicknet Technologies, Inc.'s Telephony cards + * including the Internet PhoneJACK, Internet PhoneJACK Lite, + * Internet PhoneJACK PCI, Internet LineJACK, Internet PhoneCARD and + * SmartCABLE * - * (c) Copyright 1999-2000 Quicknet Technologies, Inc. [...11308 lines suppressed...] + return 0; +} + static int ixj_init_tone(IXJ *j, IXJ_TONE * ti) { int freq0, freq1; @@ -9230,7 +10674,7 @@ { if (ixj_WriteDSPCommand(0x6800 + ti->tone_index, j)) return -1; - if (ixj_WriteDSPCommand(0x6000 + (ti->gain0 << 4) + ti->gain1, j)) + if (ixj_WriteDSPCommand(0x6000 + (ti->gain1 << 4) + ti->gain0, j)) return -1; data = freq0; if (ixj_WriteDSPCommand(data, j)) @@ -9241,3 +10685,4 @@ } return freq0; } + Index: ixj.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/telephony/ixj.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- ixj.h 25 Feb 2001 23:15:14 -0000 1.1.1.2 +++ ixj.h 9 Apr 2002 16:45:53 -0000 1.2 @@ -1,10 +1,13 @@ /****************************************************************************** * ixj.h * - * Device Driver for the Internet PhoneJACK and - * Internet LineJACK Telephony Cards. * - * (c) Copyright 1999 Quicknet Technologies, Inc. + * Device Driver for Quicknet Technologies, Inc.'s Telephony cards + * including the Internet PhoneJACK, Internet PhoneJACK Lite, + * Internet PhoneJACK PCI, Internet LineJACK, Internet PhoneCARD and + * SmartCABLE [...1116 lines suppressed...] + unsigned long iscontrolready; + unsigned long iscontrolreadyfail; + unsigned long pstnstatecheck; +#ifdef IXJ_DYN_ALLOC + short *fskdata; +#else short fskdata[8000]; +#endif + int fsksize; int fskdcnt; } IXJ; -int ixj_WriteDSPCommand(unsigned short, IXJ *); - typedef int (*IXJ_REGFUNC) (IXJ * j, unsigned long arg); -int ixj_register(int index, IXJ_REGFUNC regfunc); -int ixj_unregister(int index); +extern IXJ *ixj_pcmcia_probe(unsigned long, unsigned long); + Index: phonedev.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/telephony/phonedev.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- phonedev.c 14 Jan 2001 19:10:46 -0000 1.1.1.1 +++ phonedev.c 9 Apr 2002 16:45:53 -0000 1.2 @@ -167,5 +167,7 @@ module_init(telephony_init); module_exit(telephony_exit); +MODULE_LICENSE("GPL"); + EXPORT_SYMBOL(phone_register_device); EXPORT_SYMBOL(phone_unregister_device); |
Update of /cvsroot/linux-vax/kernel-2.4/drivers/tc In directory usw-pr-cvs1:/tmp/cvs-serv6177/tc Modified Files: Makefile tc.c zs.c zs.h Added Files: lk201-map.map lk201-remap.c lk201.c lk201.h Removed Files: tcsyms.c Log Message: synch 2.4.15 commit 27 --- NEW FILE --- # Default kernel keymap. This uses 7 modifier combinations. keymaps 0-2,4-5,8,12 # Change the above line into # keymaps 0-2,4-6,8,12 # in case you want the entries # altgr control keycode 83 = Boot # altgr control keycode 111 = Boot # below. # # In fact AltGr is used very little, and one more keymap can # be saved by mapping AltGr to Alt (and adapting a few entries): # keycode 100 = Alt # keycode 0x15 = grave tilde alt keycode 0x15 = Escape control keycode 0x15 = Meta_Escape keycode 0x16 = one exclam alt keycode 0x16 = Meta_one keycode 0x17 = two at at control keycode 0x17 = nul shift control keycode 0x17 = nul alt keycode 0x17 = Meta_two keycode 0x18 = three numbersign control keycode 0x18 = Escape alt keycode 0x18 = Meta_three keycode 0x19 = four dollar dollar control keycode 0x19 = Control_backslash alt keycode 0x19 = Meta_four keycode 0x1a = five percent control keycode 0x1a = Control_bracketright alt keycode 0x1a = Meta_five keycode 0x1b = six asciicircum control keycode 0x1b = Control_asciicircum alt keycode 0x1b = Meta_six keycode 0x1c = seven ampersand braceleft control keycode 0x1c = Control_underscore alt keycode 0x1c = Meta_seven keycode 0x1d = eight asterisk bracketleft control keycode 0x1d = Delete alt keycode 0x1d = Meta_eight keycode 0x1e = nine parenleft bracketright alt keycode 0x1e = Meta_nine keycode 0x1f = zero parenright braceright alt keycode 0x1f = Meta_zero keycode 0x20 = minus underscore backslash control keycode 0x20 = Control_underscore shift control keycode 0x20 = Control_underscore alt keycode 0x20 = Meta_minus keycode 0x21 = equal plus alt keycode 0x21 = Meta_equal keycode 0x22 = Delete Delete control keycode 0x22 = BackSpace alt keycode 0x22 = Meta_Delete keycode 0x2a = Tab Tab alt keycode 0x2a = Meta_Tab keycode 0x2b = q keycode 0x2c = w keycode 0x2d = e altgr keycode 0x2d = Hex_E keycode 0x2e = r keycode 0x2f = t keycode 0x30 = y keycode 0x31 = u keycode 0x32 = i keycode 0x33 = o keycode 0x34 = p keycode 0x35 = bracketleft braceleft control keycode 0x35 = Escape alt keycode 0x35 = Meta_bracketleft keycode 0x36 = bracketright braceright asciitilde control keycode 0x36 = Control_bracketright alt keycode 0x36 = Meta_bracketright keycode 0x37 = Return alt keycode 0x37 = Meta_Control_m keycode 0x3f = Control keycode 0x41 = a altgr keycode 0x41 = Hex_A keycode 0x42 = s keycode 0x43 = d altgr keycode 0x43 = Hex_D keycode 0x44 = f altgr keycode 0x44 = Hex_F keycode 0x45 = g keycode 0x46 = h keycode 0x47 = j keycode 0x48 = k keycode 0x49 = l keycode 0x4a = semicolon colon alt keycode 0x4a = Meta_semicolon keycode 0x4b = apostrophe quotedbl control keycode 0x4b = Control_g alt keycode 0x4b = Meta_apostrophe # keycode 41 = grave asciitilde # control keycode 41 = nul # alt keycode 41 = Meta_grave keycode 0x52 = Shift keycode 0x4c = backslash bar control keycode 0x4c = Control_backslash alt keycode 0x4c = Meta_backslash keycode 0x53 = greater less keycode 0x54 = z keycode 0x55 = x keycode 0x56 = c altgr keycode 0x56 = Hex_C keycode 0x57 = v keycode 0x58 = b altgr keycode 0x58 = Hex_B keycode 0x59 = n keycode 0x5a = m keycode 0x5b = comma less alt keycode 0x5b = Meta_comma keycode 0x5c = period greater control keycode 0x5c = Compose alt keycode 0x5c = Meta_period keycode 0x5d = slash question control keycode 0x5d = Delete alt keycode 0x5d = Meta_slash keycode 0x67 = Alt keycode 0x68 = space space control keycode 0x68 = nul alt keycode 0x68 = Meta_space keycode 0x40 = Caps_Lock keycode 0x01 = F1 control keycode 0x01 = F1 alt keycode 0x01 = Console_1 control alt keycode 0x01 = Console_1 keycode 0x02 = F2 control keycode 0x02 = F2 alt keycode 0x02 = Console_2 control alt keycode 0x02 = Console_2 keycode 0x03 = F3 control keycode 0x03 = F3 alt keycode 0x03 = Console_3 control alt keycode 0x03 = Console_3 keycode 0x04 = F4 control keycode 0x04 = F4 alt keycode 0x04 = Console_4 control alt keycode 0x04 = Console_4 keycode 0x05 = F5 control keycode 0x05 = F5 alt keycode 0x05 = Console_5 control alt keycode 0x05 = Console_5 keycode 0x06 = F6 control keycode 0x06 = F6 alt keycode 0x06 = Console_6 control alt keycode 0x06 = Console_6 keycode 0x07 = F7 control keycode 0x07 = F7 alt keycode 0x07 = Console_7 control alt keycode 0x07 = Console_7 keycode 0x08 = F8 control keycode 0x08 = F8 alt keycode 0x08 = Console_8 control alt keycode 0x08 = Console_8 keycode 0x09 = F9 control keycode 0x09 = F9 alt keycode 0x09 = Console_9 control alt keycode 0x09 = Console_9 keycode 0x0a = F10 control keycode 0x0a = F10 alt keycode 0x0a = Console_10 control alt keycode 0x0a = Console_10 keycode 0x0b = F11 control keycode 0x0b = F11 alt keycode 0x0b = Console_11 control alt keycode 0x0b = Console_11 keycode 0x0c = F12 control keycode 0x0c = F12 alt keycode 0x0c = Console_12 control alt keycode 0x0c = Console_12 keycode 0x0d = F13 control keycode 0x0d = F13 alt keycode 0x0d = Console_13 control alt keycode 0x0d = Console_13 keycode 0x0e = F14 control keycode 0x0e = F14 alt keycode 0x0e = Console_14 control alt keycode 0x0e = Console_14 keycode 0x11 = F17 control keycode 0x11 = F17 alt keycode 0x11 = Console_17 control alt keycode 0x11 = Console_17 keycode 0x12 = F18 control keycode 0x12 = F18 alt keycode 0x12 = Console_18 control alt keycode 0x12 = Console_18 keycode 0x13 = F19 control keycode 0x13 = F19 alt keycode 0x13 = Console_19 control alt keycode 0x13 = Console_19 keycode 0x14 = F20 control keycode 0x14 = F20 alt keycode 0x14 = Console_20 control alt keycode 0x14 = Console_20 keycode 0x3b = KP_7 alt keycode 0x3b = Ascii_7 altgr keycode 0x3b = Hex_7 keycode 0x3c = KP_8 alt keycode 0x3c = Ascii_8 altgr keycode 0x3c = Hex_8 keycode 0x3d = KP_9 alt keycode 0x3d = Ascii_9 altgr keycode 0x3d = Hex_9 keycode 0x3e = KP_Subtract keycode 0x4e = KP_4 alt keycode 0x4e = Ascii_4 altgr keycode 0x4e = Hex_4 keycode 0x4f = KP_5 alt keycode 0x4f = Ascii_5 altgr keycode 0x4f = Hex_5 keycode 0x50 = KP_6 alt keycode 0x50 = Ascii_6 altgr keycode 0x50 = Hex_6 keycode 0x62 = KP_1 alt keycode 0x62 = Ascii_1 altgr keycode 0x62 = Hex_1 keycode 0x63 = KP_2 alt keycode 0x63 = Ascii_2 altgr keycode 0x63 = Hex_2 keycode 0x64 = KP_3 alt keycode 0x64 = Ascii_3 altgr keycode 0x64 = Hex_3 keycode 0x6b = KP_0 alt keycode 0x6b = Ascii_0 altgr keycode 0x6b = Hex_0 keycode 0x6c = KP_Period # altgr control keycode 0x6c = Boot control alt keycode 0x6c = Boot keycode 0x65 = KP_Enter keycode 0x3f = Control # keycode 100 = AltGr keycode 0x23 = Find keycode 0x4d = Up keycode 0x39 = Prior shift keycode 0x39 = Scroll_Backward keycode 0x5f = Left alt keycode 0x5f = Decr_Console keycode 0x61 = Right alt keycode 0x61 = Incr_Console keycode 0x38 = Select keycode 0x60 = Down keycode 0x3a = Next shift keycode 0x3a = Scroll_Forward keycode 0x24 = Insert keycode 0x25 = Remove # altgr control keycode 0x25 = Boot control alt keycode 0x25 = Boot keycode 0x0f = Help Show_Memory Show_Registers control keycode 0x0f = Show_State keycode 0x10 = Do string F1 = "\033[[A" string F2 = "\033[[B" string F3 = "\033[[C" string F4 = "\033[[D" string F5 = "\033[[E" string F6 = "\033[17~" string F7 = "\033[18~" string F8 = "\033[19~" string F9 = "\033[20~" string F10 = "\033[21~" string F11 = "\033[23~" string F12 = "\033[24~" string F13 = "\033[25~" string F14 = "\033[26~" string F15 = "\033[28~" string F16 = "\033[29~" string F17 = "\033[31~" string F18 = "\033[32~" string F19 = "\033[33~" string F20 = "\033[34~" string Find = "\033[1~" string Insert = "\033[2~" string Remove = "\033[3~" string Select = "\033[4~" string Prior = "\033[5~" string Next = "\033[6~" string Macro = "\033[M" string Pause = "\033[P" compose '`' 'A' to 'À' compose '`' 'a' to 'à' compose '\'' 'A' to 'Á' compose '\'' 'a' to 'á' compose '^' 'A' to 'Â' compose '^' 'a' to 'â' compose '~' 'A' to 'Ã' compose '~' 'a' to 'ã' compose '"' 'A' to 'Ä' compose '"' 'a' to 'ä' compose 'O' 'A' to 'Å' compose 'o' 'a' to 'å' compose '0' 'A' to 'Å' compose '0' 'a' to 'å' compose 'A' 'A' to 'Å' compose 'a' 'a' to 'å' compose 'A' 'E' to 'Æ' compose 'a' 'e' to 'æ' compose ',' 'C' to 'Ç' compose ',' 'c' to 'ç' compose '`' 'E' to 'È' compose '`' 'e' to 'è' compose '\'' 'E' to 'É' compose '\'' 'e' to 'é' compose '^' 'E' to 'Ê' compose '^' 'e' to 'ê' compose '"' 'E' to 'Ë' compose '"' 'e' to 'ë' compose '`' 'I' to 'Ì' compose '`' 'i' to 'ì' compose '\'' 'I' to 'Í' compose '\'' 'i' to 'í' compose '^' 'I' to 'Î' compose '^' 'i' to 'î' compose '"' 'I' to 'Ï' compose '"' 'i' to 'ï' compose '-' 'D' to 'Ð' compose '-' 'd' to 'ð' compose '~' 'N' to 'Ñ' compose '~' 'n' to 'ñ' compose '`' 'O' to 'Ò' compose '`' 'o' to 'ò' compose '\'' 'O' to 'Ó' compose '\'' 'o' to 'ó' compose '^' 'O' to 'Ô' compose '^' 'o' to 'ô' compose '~' 'O' to 'Õ' compose '~' 'o' to 'õ' compose '"' 'O' to 'Ö' compose '"' 'o' to 'ö' compose '/' 'O' to 'Ø' compose '/' 'o' to 'ø' compose '`' 'U' to 'Ù' compose '`' 'u' to 'ù' compose '\'' 'U' to 'Ú' compose '\'' 'u' to 'ú' compose '^' 'U' to 'Û' compose '^' 'u' to 'û' compose '"' 'U' to 'Ü' compose '"' 'u' to 'ü' compose '\'' 'Y' to 'Ý' compose '\'' 'y' to 'ý' compose 'T' 'H' to 'Þ' compose 't' 'h' to 'þ' compose 's' 's' to 'ß' compose '"' 'y' to 'ÿ' compose 's' 'z' to 'ß' compose 'i' 'j' to 'ÿ' --- NEW FILE --- /* * Keyboard mappings for DEC LK201/401/501 keyboards * * 17.05.99 Michael Engel (en...@un...) * * DEC US keyboards generate keycodes in the range 0x55 - 0xfb * * This conflicts with Linux scancode conventions which define * 0x00-0x7f as "normal" and 0x80-0xff as "shifted" scancodes, so we * have to remap the keycodes to 0x00-0x7f with the scancodeRemap * array. The generated scancode is simply the number of the key counted * from the left upper to the right lower corner of the keyboard ... * * These scancodes are then being remapped (I hope ;-)) with the * lk501*map[] arrays which define scancode -> Linux code mapping * * Oh man is this horrible ;-) * * Scancodes with dual labels exist for keyboards as follows: * * code: left label / right label * * 0x73: LKx01, LK421 / LK443, LK444 * 0x74: LKx01, LK421 / LK443, LK444 * 0x7c: LKx01, LK421 / LK443, LK444 * 0x8a: LKx01, LK421 / LK443, LK444 * 0x8b: LKx01, LK421 / LK443, LK444 * 0x8c: LKx01, LK421 / LK443, LK444 * 0x8d: LKx01, LK421 / LK443, LK444 * 0x8e: LKx01, LK421 / LK443, LK444 * 0x8f: LKx01, LK421 / LK443, LK444 * 0x9c: LKx01, LK421 / LK443, LK444 * 0xa1: LKx01, LK421 / LK443, LK444 * 0xa2: LKx01, LK421 / LK443, LK444 * 0xa3: LKx01, LK421 / LK443, LK444 * 0xa4: LKx01, LK421 / LK443, LK444 * 0xad: LK421 / LK443, LK444 * 0xc9: LKx01, LK421, LK443 / LK444 * 0xf7: LKx01, LK443 / LK444 */ unsigned char scancodeRemap[256] = { /* ----- */ /* 0 */ 0, 0, 0, 0, /* ----- */ /* 4 */ 0, 0, 0, 0, /* ----- */ /* 8 */ 0, 0, 0, 0, /* ----- */ /* c */ 0, 0, 0, 0, /* ----- */ /* 10 */ 0, 0, 0, 0, /* ----- */ /* 14 */ 0, 0, 0, 0, /* ----- */ /* 18 */ 0, 0, 0, 0, /* ----- */ /* 1c */ 0, 0, 0, 0, /* ----- */ /* 20 */ 0, 0, 0, 0, /* ----- */ /* 24 */ 0, 0, 0, 0, /* ----- */ /* 28 */ 0, 0, 0, 0, /* ----- */ /* 2c */ 0, 0, 0, 0, /* ----- */ /* 30 */ 0, 0, 0, 0, /* ----- */ /* 34 */ 0, 0, 0, 0, /* ----- */ /* 38 */ 0, 0, 0, 0, /* ----- */ /* 3c */ 0, 0, 0, 0, /* ----- */ /* 40 */ 0, 0, 0, 0, /* ----- */ /* 44 */ 0, 0, 0, 0, /* ----- */ /* 48 */ 0, 0, 0, 0, /* ----- */ /* 4c */ 0, 0, 0, 0, /* ----- */ /* 50 */ 0, 0, 0, 0, /* ----- ESC F1 F2 */ /* 54 */ 0, 0, 0x01, 0x02, /* ----- F3 F4 F5 */ /* 58 */ 0x03, 0x04, 0x05, 0, /* ----- */ /* 5c */ 0, 0, 0, 0, /* ----- */ /* 60 */ 0, 0, 0, 0, /* ----- F6 F7 F8 F9 */ /* 64 */ 0x06, 0x07, 0x08, 0x09, /* ----- F10 */ /* 68 */ 0x0a, 0, 0, 0, /* ----- */ /* 6c */ 0, 0, 0, 0, /* ----- F11 F12 F13/PRNT SCRN */ /* 70 */ 0, 0x0b, 0x0c, 0x0d, /* ----- F14/SCRL LCK */ /* 74 */ 0x0e, 0, 0, 0, /* ----- */ /* 78 */ 0, 0, 0, 0, /* ----- HELP/PAUSE DO */ /* 7c */ 0x0f, 0x10, 0, 0, /* ----- F17 F18 F19 F20 */ /* 80 */ 0x11, 0x12, 0x13, 0x14, /* ----- */ /* 84 */ 0, 0, 0, 0, /* ----- FIND/INSERT INSERT/HOME */ /* 88 */ 0, 0, 0x23, 0x24, /* ----- REMOVE/PG UP SELECT/DELETE PREVIOUS/END NEXT/PG DN */ /* 8c */ 0x25, 0x38, 0x39, 0x3a, /* ----- KP 0 */ /* 90 */ 0, 0, 0x6b, 0, /* ----- KP . KP ENTER KP 1 KP 2 */ /* 94 */ 0x6c, 0x65, 0x62, 0x63, /* ----- KP 3 KP 4 KP 5 KP 6 */ /* 98 */ 0x64, 0x4e, 0x4f, 0x50, /* ----- KP ,/KP + KP 7 KP 8 KP 9 */ /* 9c */ 0x51, 0x3b, 0x3c, 0x3d, /* ----- KP - KP F1/NUM LCK KP F2/KP / KP F3/KP * */ /* a0 */ 0x3e, 0x26, 0x27, 0x28, /* ----- KP F4/KP - LEFT */ /* a4 */ 0x29, 0, 0, 0x5f, /* ----- RIGHT DOWN UP SHIFT Rt */ /* a8 */ 0x61, 0x60, 0x4d, 0x5e, /* ----- ALT COMP Rt/CTRL Rt SHIFT CONTROL */ /* ac */ 0, 0, 0x52, 0x3f, /* ----- CAPS COMPOSE ALT Rt */ /* b0 */ 0x40, 0x67, 0, 0, /* ----- */ /* b4 */ 0, 0, 0, 0, /* ----- */ /* b8 */ 0, 0, 0, 0, /* ----- BKSP RET TAB ` */ /* bc */ 0x22, 0x37, 0x2a, 0x15, /* ----- 1 q a z */ /* c0 */ 0x16, 0x2b, 0x41, 0x54, /* ----- 2 w s */ /* c4 */ 0, 0x17, 0x2c, 0x42, /* ----- x </\\ 3 */ /* c8 */ 0x55, 0x53, 0, 0x18, /* ----- e d c */ /* cc */ 0x2d, 0x43, 0x56, 0, /* ----- 4 r f v */ /* d0 */ 0x19, 0x2e, 0x44, 0x57, /* ----- SPACE 5 t */ /* d4 */ 0x68, 0, 0x1a, 0x2f, /* ----- g b 6 */ /* d8 */ 0x45, 0x58, 0, 0x1b, /* ----- y h n */ /* dc */ 0x30, 0x46, 0x59, 0, /* ----- 7 u j m */ /* e0 */ 0x1c, 0x31, 0x47, 0x5a, /* ----- 8 i k */ /* e4 */ 0, 0x1d, 0x32, 0x48, /* ----- , 9 o */ /* e8 */ 0x5b, 0, 0x1e, 0x33, /* ----- l . 0 */ /* ec */ 0x49, 0x5c, 0, 0x1f, /* ----- p ; / */ /* f0 */ 0x34, 0, 0x4a, 0x5d, /* ----- = ] \\/\' */ /* f4 */ 0, 0x21, 0x36, 0x4c, /* ----- - [ \' */ /* f8 */ 0, 0x20, 0x35, 0x4b, /* ----- */ /* fc */ 0, 0, 0, 0, }; --- NEW FILE --- /* * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * */ #include <linux/errno.h> #include <linux/tty.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/kbd_ll.h> #include <asm/wbflush.h> #include <asm/dec/tc.h> #include <asm/dec/machtype.h> #include "zs.h" #include "lk201.h" /* Simple translation table for the SysRq keys */ #ifdef CONFIG_MAGIC_SYSRQ /* * Actually no translation at all, at least until we figure out * how to define SysRq for LK201 and friends. --macro */ unsigned char lk201_sysrq_xlate[128]; unsigned char *kbd_sysrq_xlate = lk201_sysrq_xlate; #endif #define KEYB_LINE 3 static int __init lk201_init(struct dec_serial *); static void __init lk201_info(struct dec_serial *); static void lk201_kbd_rx_char(unsigned char, unsigned char); struct zs_hook lk201_kbdhook = { init_channel: lk201_init, init_info: lk201_info, rx_char: NULL, poll_rx_char: NULL, poll_tx_char: NULL, cflags: B4800 | CS8 | CSTOPB | CLOCAL }; /* * This is used during keyboard initialisation */ static unsigned char lk201_reset_string[] = { LK_CMD_LEDS_ON, LK_PARAM_LED_MASK(0xf), /* show we are resetting */ LK_CMD_SET_DEFAULTS, LK_CMD_MODE(LK_MODE_RPT_DOWN, 1), LK_CMD_MODE(LK_MODE_RPT_DOWN, 2), LK_CMD_MODE(LK_MODE_RPT_DOWN, 3), LK_CMD_MODE(LK_MODE_RPT_DOWN, 4), LK_CMD_MODE(LK_MODE_DOWN_UP, 5), LK_CMD_MODE(LK_MODE_DOWN_UP, 6), LK_CMD_MODE(LK_MODE_RPT_DOWN, 7), LK_CMD_MODE(LK_MODE_RPT_DOWN, 8), LK_CMD_MODE(LK_MODE_RPT_DOWN, 9), LK_CMD_MODE(LK_MODE_RPT_DOWN, 10), LK_CMD_MODE(LK_MODE_RPT_DOWN, 11), LK_CMD_MODE(LK_MODE_RPT_DOWN, 12), LK_CMD_MODE(LK_MODE_DOWN, 13), LK_CMD_MODE(LK_MODE_RPT_DOWN, 14), LK_CMD_ENB_RPT, LK_CMD_DIS_KEYCLK, LK_CMD_RESUME, LK_CMD_ENB_BELL, LK_PARAM_VOLUME(4), LK_CMD_LEDS_OFF, LK_PARAM_LED_MASK(0xf) }; static int __init lk201_reset(struct dec_serial *info) { int i; for (i = 0; i < sizeof(lk201_reset_string); i++) if (info->hook->poll_tx_char(info, lk201_reset_string[i])) { printk(__FUNCTION__" transmit timeout\n"); return -EIO; } return 0; } void kbd_leds(unsigned char leds) { return; } int kbd_setkeycode(unsigned int scancode, unsigned int keycode) { return -EINVAL; } int kbd_getkeycode(unsigned int scancode) { return -EINVAL; } int kbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode) { *keycode = scancode; return 1; } char kbd_unexpected_up(unsigned char keycode) { return 0x80; } static void lk201_kbd_rx_char(unsigned char ch, unsigned char stat) { static int shift_state = 0; static int prev_scancode; unsigned char c = scancodeRemap[ch]; if (!stat || stat == 4) { switch (ch) { case LK_KEY_ACK: break; case LK_KEY_LOCK: shift_state ^= LK_LOCK; handle_scancode(c, shift_state && LK_LOCK ? 1 : 0); break; case LK_KEY_SHIFT: shift_state ^= LK_SHIFT; handle_scancode(c, shift_state && LK_SHIFT ? 1 : 0); break; case LK_KEY_CTRL: shift_state ^= LK_CTRL; handle_scancode(c, shift_state && LK_CTRL ? 1 : 0); break; case LK_KEY_COMP: shift_state ^= LK_COMP; handle_scancode(c, shift_state && LK_COMP ? 1 : 0); break; case LK_KEY_RELEASE: if (shift_state & LK_SHIFT) handle_scancode(scancodeRemap[LK_KEY_SHIFT], 0); if (shift_state & LK_CTRL) handle_scancode(scancodeRemap[LK_KEY_CTRL], 0); if (shift_state & LK_COMP) handle_scancode(scancodeRemap[LK_KEY_COMP], 0); if (shift_state & LK_LOCK) handle_scancode(scancodeRemap[LK_KEY_LOCK], 0); shift_state = 0; break; case LK_KEY_REPEAT: handle_scancode(prev_scancode, 1); break; default: prev_scancode = c; handle_scancode(c, 1); break; } } else printk("Error reading LKx01 keyboard: 0x%02x\n", stat); } static void __init lk201_info(struct dec_serial *info) { } static int __init lk201_init(struct dec_serial *info) { unsigned int ch, id = 0; int result; printk("DECstation LK keyboard driver v0.04... "); result = lk201_reset(info); if (result) return result; mdelay(10); /* * Detect whether there is an LK201 or an LK401 * The LK401 has ALT keys... */ info->hook->poll_tx_char(info, LK_CMD_REQ_ID); while ((ch = info->hook->poll_rx_char(info)) > 0) id = ch; switch (id) { case 1: printk("LK201 detected\n"); break; case 2: printk("LK401 detected\n"); break; default: printk("unknown keyboard, ID %d,\n", id); printk("... please report to <lin...@os...>\n"); } /* * now we're ready */ info->hook->rx_char = lk201_kbd_rx_char; return 0; } void __init kbd_init_hw(void) { extern int register_zs_hook(unsigned int, struct zs_hook *); extern int unregister_zs_hook(unsigned int); if (TURBOCHANNEL) { if (mips_machtype != MACH_DS5000_XX) { /* * This is not a MAXINE, so: * * kbd_init_hw() is being called before * rs_init() so just register the kbd hook * and let zs_init do the rest :-) */ if (mips_machtype == MACH_DS5000_200) printk("LK201 Support for DS5000/200 not yet ready ...\n"); else if(!register_zs_hook(KEYB_LINE, &lk201_kbdhook)) unregister_zs_hook(KEYB_LINE); } } else { /* * TODO: modify dz.c to allow similar hooks * for LK201 handling on DS2100, DS3100, and DS5000/200 */ printk("LK201 Support for DS3100 not yet ready ...\n"); } } --- NEW FILE --- /* * Commands to the keyboard processor */ #define LK_PARAM 0x80 /* start/end parameter list */ #define LK_CMD_RESUME 0x8b #define LK_CMD_INHIBIT 0xb9 #define LK_CMD_LEDS_ON 0x13 /* 1 param: led bitmask */ #define LK_CMD_LEDS_OFF 0x11 /* 1 param: led bitmask */ #define LK_CMD_DIS_KEYCLK 0x99 #define LK_CMD_ENB_KEYCLK 0x1b /* 1 param: volume */ #define LK_CMD_DIS_CTLCLK 0xb9 #define LK_CMD_ENB_CTLCLK 0xbb #define LK_CMD_SOUND_CLK 0x9f #define LK_CMD_DIS_BELL 0xa1 #define LK_CMD_ENB_BELL 0x23 /* 1 param: volume */ #define LK_CMD_BELL 0xa7 #define LK_CMD_TMP_NORPT 0xc1 #define LK_CMD_ENB_RPT 0xe3 #define LK_CMD_DIS_RPT 0xe1 #define LK_CMD_RPT_TO_DOWN 0xd9 #define LK_CMD_REQ_ID 0xab #define LK_CMD_POWER_UP 0xfd #define LK_CMD_TEST_MODE 0xcb #define LK_CMD_SET_DEFAULTS 0xd3 /* there are 4 leds, represent them in the low 4 bits of a byte */ #define LK_PARAM_LED_MASK(ledbmap) (LK_PARAM|(ledbmap)) /* max volume is 0, lowest is 0x7 */ #define LK_PARAM_VOLUME(v) (LK_PARAM|((v)&0x7)) /* mode set command(s) details */ #define LK_MODE_DOWN 0x0 #define LK_MODE_RPT_DOWN 0x2 #define LK_MODE_DOWN_UP 0x6 #define LK_CMD_MODE(m,div) (LK_PARAM|(div<<3)|m) #define LK_SHIFT 1<<0 #define LK_CTRL 1<<1 #define LK_LOCK 1<<2 #define LK_COMP 1<<3 #define LK_KEY_SHIFT 174 #define LK_KEY_CTRL 175 #define LK_KEY_LOCK 176 #define LK_KEY_COMP 177 #define LK_KEY_RELEASE 179 #define LK_KEY_REPEAT 180 #define LK_KEY_ACK 186 extern unsigned char scancodeRemap[256]; Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/tc/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 19:05:54 -0000 1.1.1.1 +++ Makefile 9 Apr 2002 16:45:53 -0000 1.2 @@ -7,27 +7,36 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -SUB_DIRS := -MOD_SUB_DIRS := -ALL_SUB_DIRS := - -L_TARGET := tc.a -L_OBJS := tc.o - -# Nasty trick as nobody references tcsyms.o, but we still want it linked. -# Stolen from pci Makefile -ifeq ($(CONFIG_MODULES),y) -O_TARGET = tc_syms.o -OX_OBJS = tcsyms.o -O_OBJS = tc.o -L_OBJS := tc_syms.o -else -L_OBJS := tc.o -endif - -ifdef CONFIG_ZS -L_OBJS += zs.o -endif +# All of the (potential) objects that export symbols. +# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. + +export-objs := tc.o + +# Object file lists. + +obj-y := +obj-m := +obj-n := +obj- := + +obj-$(CONFIG_TC) += tc.o +obj-$(CONFIG_ZS) += zs.o +obj-$(CONFIG_VT) += lk201.o lk201-map.o lk201-remap.o + +# Files that are both resident and modular: remove from modular. + +obj-m := $(filter-out $(obj-y), $(obj-m)) + +# Translate to Rules.make lists. + +L_TARGET := tc.a + +L_OBJS := $(sort $(filter-out $(export-objs), $(obj-y))) +LX_OBJS := $(sort $(filter $(export-objs), $(obj-y))) +M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) +MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) include $(TOPDIR)/Rules.make +lk201-map.c: lk201-map.map + loadkeys --mktable lk201-map.map > lk201-map.c Index: tc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/tc/tc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- tc.c 14 Jan 2001 19:05:54 -0000 1.1.1.1 +++ tc.c 9 Apr 2002 16:45:53 -0000 1.2 @@ -1,4 +1,4 @@ -/* $Id$ +/* * tc-init: We assume the TURBOchannel to be up and running so * just probe for Modules and fill in the global data structure * tc_bus. @@ -8,9 +8,7 @@ * for more details. * * Copyright (c) Harald Koerfgen, 1998 - * */ - #include <linux/string.h> #include <linux/init.h> #include <linux/ioport.h> @@ -23,14 +21,16 @@ #include <asm/ptrace.h> #include <linux/kernel.h> +#include <linux/module.h> #define TC_DEBUG +MODULE_LICENSE("GPL"); slot_info tc_bus[MAX_SLOT]; -static int max_tcslot = 0; -static tcinfo *info = (tcinfo *)0; +static int max_tcslot; +static tcinfo *info; -unsigned long system_base = 0; +unsigned long system_base; extern void (*dbe_board_handler)(struct pt_regs *regs); extern unsigned long *(*rex_slot_address)(int); @@ -112,19 +112,19 @@ for (slot = 0; slot <= max_slot; slot++) { module = (char *)(startaddr + slot * size); offset = -1; - if (module[OLDCARD + PATTERN0] == 0x55 && module[OLDCARD + PATTERN1] == 0x00 - && module[OLDCARD + PATTERN2] == 0xaa && module[OLDCARD + PATTERN3] == 0xff) + if (module[OLDCARD + TC_PATTERN0] == 0x55 && module[OLDCARD + TC_PATTERN1] == 0x00 + && module[OLDCARD + TC_PATTERN2] == 0xaa && module[OLDCARD + TC_PATTERN3] == 0xff) offset = OLDCARD; - if (module[PATTERN0] == 0x55 && module[PATTERN1] == 0x00 - && module[PATTERN2] == 0xaa && module[PATTERN3] == 0xff) + if (module[TC_PATTERN0] == 0x55 && module[TC_PATTERN1] == 0x00 + && module[TC_PATTERN2] == 0xaa && module[TC_PATTERN3] == 0xff) offset = 0; if (offset != -1) { tc_bus[slot].base_addr = (unsigned long)module; for(i = 0; i < 8; i++) { - tc_bus[slot].firmware[i] = module[FIRM_VER + offset + 4 * i]; - tc_bus[slot].vendor[i] = module[VENDOR + offset + 4 * i]; - tc_bus[slot].name[i] = module[MODULE + offset + 4 * i]; + tc_bus[slot].firmware[i] = module[TC_FIRM_VER + offset + 4 * i]; + tc_bus[slot].vendor[i] = module[TC_VENDOR + offset + 4 * i]; + tc_bus[slot].name[i] = module[TC_MODULE + offset + 4 * i]; } tc_bus[slot].firmware[8] = 0; tc_bus[slot].vendor[8] = 0; @@ -206,7 +206,7 @@ if (TURBOCHANNEL && info->slot_size && slot0addr) { printk("TURBOchannel rev. %1d at %2d.%1d MHz ", info->revision, tc_clock / 10, tc_clock % 10); - printk("(%sparity)\n", info->parity ? "" : "no "); + printk("(with%s parity)\n", info->parity ? "" : "out"); slot_size = info->slot_size << 20; @@ -235,3 +235,11 @@ ioport_resource.end = KSEG2 - 1; } } + +EXPORT_SYMBOL(search_tc_card); +EXPORT_SYMBOL(claim_tc_card); +EXPORT_SYMBOL(release_tc_card); +EXPORT_SYMBOL(get_tc_base_addr); +EXPORT_SYMBOL(get_tc_irq_nr); +EXPORT_SYMBOL(get_tc_speed); + Index: zs.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/tc/zs.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- zs.c 14 Jan 2001 19:06:02 -0000 1.1.1.1 +++ zs.c 9 Apr 2002 16:45:53 -0000 1.2 @@ -1,22 +1,46 @@ /* - * decserial.c: Serial port driver for IOASIC DECsatations. + * decserial.c: Serial port driver for IOASIC DECstations. * - * Derived from drivers/macintosh/macserial.c by Harald Koerfgen. * Derived from drivers/sbus/char/sunserial.c by Paul Mackerras. + * Derived from drivers/macintosh/macserial.c by Harald Koerfgen. * * DECstation changes - * Copyright (C) 1998 Harald Koerfgen (Har...@ho...) + * Copyright (C) 1998-2000 Harald Koerfgen [...1305 lines suppressed...] +} + void __init zs_kgdb_hook(int tty_num) { /* Find out how many Z8530 SCCs we have */ @@ -2084,11 +2392,12 @@ zs_soft[tty_num].change_needed = 0; zs_soft[tty_num].clk_divisor = 16; zs_soft[tty_num].zs_baud = 38400; - zs_soft[tty_num].kgdb_channel = 1; /* This runs kgdb */ - zs_soft[tty_num ^ 1].kgdb_channel = 0; /* This does not */ + zs_soft[tty_num].hook = &zs_kgdbhook; /* This runs kgdb */ /* Turn on transmitter/receiver at 8-bits/char */ kgdb_chaninit(zs_soft[tty_num].zs_channel, 1, 38400); printk("KGDB: on channel %d initialized\n", tty_num); set_debug_traps(); /* init stub */ } #endif /* ifdef CONFIG_KGDB */ + + Index: zs.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/tc/zs.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- zs.h 14 Jan 2001 19:06:04 -0000 1.1.1.1 +++ zs.h 9 Apr 2002 16:45:53 -0000 1.2 @@ -89,6 +89,18 @@ unsigned char curregs[NUM_ZSREGS]; }; +struct dec_serial; + +struct zs_hook { + int (*init_channel)(struct dec_serial* info); + void (*init_info)(struct dec_serial* info); + void (*rx_char)(unsigned char ch, unsigned char stat); + int (*poll_rx_char)(struct dec_serial* info); + int (*poll_tx_char)(struct dec_serial* info, + unsigned char ch); + unsigned cflags; +}; + struct dec_serial { struct dec_serial *zs_next; /* For IRQ servicing chain */ struct dec_zschannel *zs_channel; /* Channel registers */ @@ -97,7 +109,7 @@ char soft_carrier; /* Use soft carrier on this channel */ char break_abort; /* Is serial console in, so process brk/abrt */ - char kgdb_channel; /* Kgdb is running on this channel */ + struct zs_hook *hook; /* Hook on this channel */ char is_cons; /* Is this our console. */ unsigned char tx_active; /* character is being xmitted */ unsigned char tx_stopped; /* output is suspended */ --- tcsyms.c DELETED --- |
From: Andy P. <at...@us...> - 2002-04-09 17:08:30
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/pnp In directory usw-pr-cvs1:/tmp/cvs-serv6177/pnp Modified Files: Makefile isapnp.c quirks.c Log Message: synch 2.4.15 commit 27 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/pnp/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 18:49:19 -0000 1.1.1.1 +++ Makefile 9 Apr 2002 16:45:52 -0000 1.2 @@ -11,7 +11,7 @@ O_TARGET := pnp.o export-objs := isapnp.o -multi-objs := isa-pnp.o +list-multi := isa-pnp.o proc-$(CONFIG_PROC_FS) = isapnp_proc.o isa-pnp-objs := isapnp.o quirks.o $(proc-y) Index: isapnp.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/pnp/isapnp.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- isapnp.c 25 Feb 2001 23:15:11 -0000 1.1.1.2 +++ isapnp.c 9 Apr 2002 16:45:52 -0000 1.2 @@ -22,6 +22,12 @@ * Peter Denison <pe...@pn...> * 2000-06-14 Added isapnp_probe_devs() and isapnp_activate_dev() * Christoph Hellwig <hc...@ca...> + * 2001-06-03 Added release_region calls to correspond with + * request_region calls when a failure occurs. Also + * added KERN_* constants to printk() calls. + * 2001-11-07 Added isapnp_{,un}register_driver calls along the lines + * of the pci driver interface + * Kai Germaschewski <kai...@gm...> */ #include <linux/config.h> @@ -55,7 +61,7 @@ struct resource *isapnp_rdp_res; int isapnp_disable; /* Disable ISA PnP */ -int isapnp_rdp; /* Read Data Port */ +int isapnp_rdp; /* Read Data Port */ int isapnp_reset = 1; /* reset all PnP cards (deactivate) */ int isapnp_skip_pci_scan; /* skip PCI resource scanning */ int isapnp_verbose = 1; /* verbose mode */ @@ -84,6 +90,7 @@ MODULE_PARM_DESC(isapnp_reserve_io, "ISA Plug & Play - reserve I/O region(s) - port,size"); MODULE_PARM(isapnp_reserve_mem, "1-16i"); MODULE_PARM_DESC(isapnp_reserve_mem, "ISA Plug & Play - reserve memory region(s) - address,size"); +MODULE_LICENSE("GPL"); #define _PIDXR 0x279 #define _PNPWRP 0xa79 @@ -407,7 +414,7 @@ *size = tag & 0x07; } #if 0 - printk("tag = 0x%x, type = 0x%x, size = %i\n", tag, *type, *size); + printk(KERN_DEBUG "tag = 0x%x, type = 0x%x, size = %i\n", tag, *type, *size); #endif if (type == 0) /* wrong type */ return -1; @@ -887,7 +894,7 @@ isapnp_skip_bytes(size); return 1; default: - printk("isapnp: unexpected or unknown tag type 0x%x for logical device %i (device %i), ignored\n", type, dev->devfn, card->number); + printk(KERN_ERR "isapnp: unexpected or unknown tag type 0x%x for logical device %i (device %i), ignored\n", type, dev->devfn, card->number); } __skip: if (size > 0) @@ -941,7 +948,7 @@ isapnp_skip_bytes(size); return; default: - printk("isapnp: unexpected or unknown tag type 0x%x for device %i, ignored\n", type, card->number); + printk(KERN_ERR "isapnp: unexpected or unknown tag type 0x%x for device %i, ignored\n", type, card->number); } __skip: if (size > 0) @@ -988,15 +995,20 @@ isapnp_peek(header, 9); checksum = isapnp_checksum(header); #if 0 - printk("vendor: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", + printk(KERN_DEBUG "vendor: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", header[0], header[1], header[2], header[3], header[4], header[5], header[6], header[7], header[8]); - printk("checksum = 0x%x\n", checksum); + printk(KERN_DEBUG "checksum = 0x%x\n", checksum); #endif - if (checksum == 0x00 || checksum != header[8]) /* not valid CSN */ + /* Don't be strict on the checksum, here ! + e.g. 'SCM SwapBox Plug and Play' has header[8]==0 (should be: b7)*/ + if (header[8] == 0) + ; + else if (checksum == 0x00 || checksum != header[8]) /* not valid CSN */ continue; if ((card = isapnp_alloc(sizeof(struct pci_bus))) == NULL) continue; + card->number = csn; card->vendor = (header[1] << 8) | header[0]; card->device = (header[3] << 8) | header[2]; @@ -1006,7 +1018,7 @@ INIT_LIST_HEAD(&card->devices); isapnp_parse_resource_map(card); if (isapnp_checksum_value != 0x00) - printk("isapnp: checksum for device %i is not valid (0x%x)\n", csn, isapnp_checksum_value); + printk(KERN_ERR "isapnp: checksum for device %i is not valid (0x%x)\n", csn, isapnp_checksum_value); card->checksum = isapnp_checksum_value; list_add_tail(&card->node, &isapnp_cards); @@ -1665,8 +1677,8 @@ } isapnp_for_each_dev(dev) { if (dev->active) { - if (dev->irq_resource[0].start == irq || - dev->irq_resource[1].start == irq) + if ((dev->irq_resource[0].flags && dev->irq_resource[0].start == irq) || + (dev->irq_resource[1].flags && dev->irq_resource[1].start == irq)) return 1; } } @@ -1755,7 +1767,8 @@ } isapnp_for_each_dev(dev) { if (dev->active) { - if (dev->dma_resource[0].start == dma || dev->dma_resource[1].start == dma) + if ((dev->dma_resource[0].flags && dev->dma_resource[0].start == dma) || + (dev->dma_resource[1].flags && dev->dma_resource[1].start == dma)) return 1; } } @@ -1776,6 +1789,10 @@ static int isapnp_valid_dma(struct isapnp_cfgtmp *cfg, int idx) { + /* DMA priority: this table is good for i386 */ + static unsigned short xtab[16] = { + 1, 3, 5, 6, 7, 0, 2, 4 + }; int err, i; unsigned long *value1, *value2; struct isapnp_dma *dma; @@ -1791,15 +1808,16 @@ value1 = &cfg->result.dma_resource[idx].start; value2 = &cfg->result.dma_resource[idx].end; if (cfg->result.dma_resource[idx].flags & IORESOURCE_AUTO) { - for (i = 0; i < 8 && !(dma->map & (1<<i)); i++); + for (i = 0; i < 8 && !(dma->map & (1<<xtab[i])); i++); if (i >= 8) return -ENOENT; cfg->result.dma_resource[idx].flags &= ~IORESOURCE_AUTO; - if (!isapnp_check_dma(cfg, *value1 = *value2 = i, idx)) + if (!isapnp_check_dma(cfg, *value1 = *value2 = xtab[i], idx)) return 0; } do { - for (i = *value1 + 1; i < 8 && !(dma->map & (1<<i)); i++); + for (i = 0; i < 8 && xtab[i] != *value1; i++); + for (i++; i < 8 && !(dma->map & (1<<xtab[i])); i++); if (i >= 8) { if (dma->res && dma->res->alt) { if ((err = isapnp_alternative_switch(cfg, dma->res, dma->res->alt))<0) @@ -1808,7 +1826,7 @@ } return -ENOENT; } else { - *value1 = *value2 = i; + *value1 = *value2 = xtab[i]; } } while (isapnp_check_dma(cfg, *value1, idx)); return 0; @@ -2147,6 +2165,89 @@ #endif } +static int isapnp_announce_device(struct isapnp_driver *drv, + struct pci_dev *dev) +{ + const struct isapnp_device_id *id; + int ret = 0; + + if (drv->id_table) { + id = isapnp_match_dev(drv->id_table, dev); + if (!id) { + ret = 0; + goto out; + } + } else + id = NULL; + + if (drv->probe(dev, id) >= 0) { + dev->driver = (struct pci_driver *) drv; + ret = 1; + } +out: + return ret; +} + +/** + * isapnp_dev_driver - get the isapnp_driver of a device + * @dev: the device to query + * + * Returns the appropriate isapnp_driver structure or %NULL if there is no + * registered driver for the device. + */ +static struct isapnp_driver *isapnp_dev_driver(const struct pci_dev *dev) +{ + return (struct isapnp_driver *) dev->driver; +} + +static LIST_HEAD(isapnp_drivers); + +/** + * isapnp_register_driver - register a new ISAPnP driver + * @drv: the driver structure to register + * + * Adds the driver structure to the list of registered ISAPnP drivers + * Returns the number of isapnp devices which were claimed by the driver + * during registration. The driver remains registered even if the + * return value is zero. + */ +int isapnp_register_driver(struct isapnp_driver *drv) +{ + struct pci_dev *dev; + int count = 0; + + list_add_tail(&drv->node, &isapnp_drivers); + + isapnp_for_each_dev(dev) { + if (!isapnp_dev_driver(dev)) + count += isapnp_announce_device(drv, dev); + } + return count; +} + +/** + * isapnp_unregister_driver - unregister an isapnp driver + * @drv: the driver structure to unregister + * + * Deletes the driver structure from the list of registered ISAPnP drivers, + * gives it a chance to clean up by calling its remove() function for + * each device it was responsible for, and marks those devices as + * driverless. + */ +void isapnp_unregister_driver(struct isapnp_driver *drv) +{ + struct pci_dev *dev; + + list_del(&drv->node); + isapnp_for_each_dev(dev) { + if (dev->driver == (struct pci_driver *) drv) { + if (drv->remove) + drv->remove(dev); + dev->driver = NULL; + } + } +} + EXPORT_SYMBOL(isapnp_cards); EXPORT_SYMBOL(isapnp_devices); EXPORT_SYMBOL(isapnp_present); @@ -2168,6 +2269,8 @@ EXPORT_SYMBOL(isapnp_probe_devs); EXPORT_SYMBOL(isapnp_activate_dev); EXPORT_SYMBOL(isapnp_resource_change); +EXPORT_SYMBOL(isapnp_register_driver); +EXPORT_SYMBOL(isapnp_unregister_driver); int __init isapnp_init(void) { @@ -2176,19 +2279,22 @@ if (isapnp_disable) { isapnp_detected = 0; - printk("isapnp: ISA Plug & Play support disabled\n"); + printk(KERN_INFO "isapnp: ISA Plug & Play support disabled\n"); return 0; } #ifdef ISAPNP_REGION_OK pidxr_res=request_region(_PIDXR, 1, "isapnp index"); if(!pidxr_res) { - printk("isapnp: Index Register 0x%x already used\n", _PIDXR); + printk(KERN_ERR "isapnp: Index Register 0x%x already used\n", _PIDXR); return -EBUSY; } #endif pnpwrp_res=request_region(_PNPWRP, 1, "isapnp write"); if(!pnpwrp_res) { - printk("isapnp: Write Data Register 0x%x already used\n", _PNPWRP); + printk(KERN_ERR "isapnp: Write Data Register 0x%x already used\n", _PNPWRP); +#ifdef ISAPNP_REGION_OK + release_region(_PIDXR, 1); +#endif return -EBUSY; } @@ -2197,12 +2303,16 @@ * so let the user know where. */ - printk("isapnp: Scanning for Pnp cards...\n"); + printk(KERN_INFO "isapnp: Scanning for PnP cards...\n"); if (isapnp_rdp >= 0x203 && isapnp_rdp <= 0x3ff) { isapnp_rdp |= 3; isapnp_rdp_res=request_region(isapnp_rdp, 1, "isapnp read"); if(!isapnp_rdp_res) { - printk("isapnp: Read Data Register 0x%x already used\n", isapnp_rdp); + printk(KERN_ERR "isapnp: Read Data Register 0x%x already used\n", isapnp_rdp); +#ifdef ISAPNP_REGION_OK + release_region(_PIDXR, 1); +#endif + release_region(isapnp_rdp, 1); return -EBUSY; } isapnp_set_rdp(); @@ -2214,7 +2324,7 @@ (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff)) { isapnp_free_all_resources(); isapnp_detected = 0; - printk("isapnp: No Plug & Play device found\n"); + printk(KERN_INFO "isapnp: No Plug & Play device found\n"); return 0; } isapnp_rdp_res=request_region(isapnp_rdp, 1, "isapnp read"); @@ -2226,19 +2336,19 @@ cards++; if (isapnp_verbose) { struct list_head *devlist; - printk( "isapnp: Card '%s'\n", card->name[0]?card->name:"Unknown"); + printk(KERN_INFO "isapnp: Card '%s'\n", card->name[0]?card->name:"Unknown"); if (isapnp_verbose < 2) continue; for (devlist = card->devices.next; devlist != &card->devices; devlist = devlist->next) { struct pci_dev *dev = pci_dev_b(devlist); - printk("isapnp: Device '%s'\n", dev->name[0]?card->name:"Unknown"); + printk(KERN_INFO "isapnp: Device '%s'\n", dev->name[0]?card->name:"Unknown"); } } } if (cards) { - printk("isapnp: %i Plug & Play card%s detected total\n", cards, cards>1?"s":""); + printk(KERN_INFO "isapnp: %i Plug & Play card%s detected total\n", cards, cards>1?"s":""); } else { - printk("isapnp: No Plug & Play card found\n"); + printk(KERN_INFO "isapnp: No Plug & Play card found\n"); } #ifdef CONFIG_PROC_FS isapnp_proc_init(); @@ -2258,5 +2368,86 @@ if (isapnp_detected) isapnp_free_all_resources(); } + +#else + +/* format is: noisapnp */ + +static int __init isapnp_setup_disable(char *str) +{ + isapnp_disable = 1; + return 1; +} + +__setup("noisapnp", isapnp_setup_disable); + +/* format is: isapnp=rdp,reset,skip_pci_scan,verbose */ + +static int __init isapnp_setup_isapnp(char *str) +{ + (void)((get_option(&str,&isapnp_rdp) == 2) && + (get_option(&str,&isapnp_reset) == 2) && + (get_option(&str,&isapnp_skip_pci_scan) == 2) && + (get_option(&str,&isapnp_verbose) == 2)); + return 1; +} + +__setup("isapnp=", isapnp_setup_isapnp); + +/* format is: isapnp_reserve_irq=irq1[,irq2] .... */ + +static int __init isapnp_setup_reserve_irq(char *str) +{ + int i; + + for (i = 0; i < 16; i++) + if (get_option(&str,&isapnp_reserve_irq[i]) != 2) + break; + return 1; +} + +__setup("isapnp_reserve_irq=", isapnp_setup_reserve_irq); + +/* format is: isapnp_reserve_dma=dma1[,dma2] .... */ + +static int __init isapnp_setup_reserve_dma(char *str) +{ + int i; + + for (i = 0; i < 8; i++) + if (get_option(&str,&isapnp_reserve_dma[i]) != 2) + break; + return 1; +} + +__setup("isapnp_reserve_dma=", isapnp_setup_reserve_dma); + +/* format is: isapnp_reserve_io=io1,size1[,io2,size2] .... */ + +static int __init isapnp_setup_reserve_io(char *str) +{ + int i; + + for (i = 0; i < 16; i++) + if (get_option(&str,&isapnp_reserve_io[i]) != 2) + break; + return 1; +} + +__setup("isapnp_reserve_io=", isapnp_setup_reserve_io); + +/* format is: isapnp_reserve_mem=mem1,size1[,mem2,size2] .... */ + +static int __init isapnp_setup_reserve_mem(char *str) +{ + int i; + + for (i = 0; i < 16; i++) + if (get_option(&str,&isapnp_reserve_mem[i]) != 2) + break; + return 1; +} + +__setup("isapnp_reserve_mem=", isapnp_setup_reserve_mem); #endif Index: quirks.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/pnp/quirks.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- quirks.c 14 Jan 2001 18:49:31 -0000 1.1.1.1 +++ quirks.c 9 Apr 2002 16:45:52 -0000 1.2 @@ -8,7 +8,7 @@ * * Heavily based on PCI quirks handling which is * - * Copyright (c) 1999 Martin Mares <mj...@su...> + * Copyright (c) 1999 Martin Mares <mj...@uc...> */ #include <linux/types.h> |
From: Andy P. <at...@us...> - 2002-04-09 17:08:29
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/zorro In directory usw-pr-cvs1:/tmp/cvs-serv6177/zorro Modified Files: gen-devlist.c names.c proc.c zorro.c zorro.ids Log Message: synch 2.4.15 commit 27 Index: gen-devlist.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/zorro/gen-devlist.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- gen-devlist.c 14 Jan 2001 18:59:54 -0000 1.1.1.1 +++ gen-devlist.c 9 Apr 2002 16:45:52 -0000 1.2 @@ -5,7 +5,7 @@ * * Based on the PCI version: * - * (c) 1999--2000 Martin Mares <mj...@su...> + * (c) 1999--2000 Martin Mares <mj...@uc...> */ #include <stdio.h> Index: names.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/zorro/names.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- names.c 14 Jan 2001 18:59:53 -0000 1.1.1.1 +++ names.c 9 Apr 2002 16:45:52 -0000 1.2 @@ -37,9 +37,9 @@ * real memory.. Parse the same file multiple times * to get all the info. */ -#define MANUF( manuf, name ) static const char __manufstr_##manuf[] __initdata = name; +#define MANUF( manuf, name ) static char __manufstr_##manuf[] __initdata = name; #define ENDMANUF() -#define PRODUCT( manuf, prod, name ) static const char __prodstr_##manuf##prod[] __initdata = name; +#define PRODUCT( manuf, prod, name ) static char __prodstr_##manuf##prod[] __initdata = name; #include "devlist.h" @@ -48,7 +48,7 @@ #define PRODUCT( manuf, prod, name ) { 0x##prod, 0, __prodstr_##manuf##prod }, #include "devlist.h" -static const struct zorro_manuf_info __initdata zorro_manuf_list[] = { +static struct zorro_manuf_info __initdata zorro_manuf_list[] = { #define MANUF( manuf, name ) { 0x##manuf, sizeof(__prods_##manuf) / sizeof(struct zorro_prod_info), __manufstr_##manuf, __prods_##manuf }, #define ENDMANUF() #define PRODUCT( manuf, prod, name ) Index: proc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/zorro/proc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: zorro.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/zorro/zorro.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- zorro.c 14 Jan 2001 18:59:51 -0000 1.1.1.1 +++ zorro.c 9 Apr 2002 16:45:52 -0000 1.2 @@ -173,3 +173,5 @@ EXPORT_SYMBOL(zorro_find_device); EXPORT_SYMBOL(zorro_unused_z2ram); + +MODULE_LICENSE("GPL"); Index: zorro.ids =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/zorro/zorro.ids,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 |
From: Andy P. <at...@us...> - 2002-04-09 17:08:28
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/s390 In directory usw-pr-cvs1:/tmp/cvs-serv13825/s390 Modified Files: Makefile config.in defconfig vmlinux.lds Added Files: vmlinux-shared.lds Log Message: synch 2.4.15 commit 29 --- NEW FILE --- /* ld script to make s390 Linux kernel * Written by Martin Schwidefsky (sch...@de...) */ OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") OUTPUT_ARCH(s390) ENTRY(_start) SECTIONS { . = 0x00000000; _text = .; /* Text and read-only data */ .text : { *(.text) *(.fixup) *(.gnu.warning) } = 0x0700 .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 = .; __start___kallsyms = .; /* All kernel symbols */ __kallsyms : { *(__kallsyms) } __stop___kallsyms = .; . = ALIGN(1048576); /* VM shared segments are 1MB aligned */ _etext = .; /* End of text section */ .data : { /* Data */ *(.data) CONSTRUCTORS } _edata = .; /* End of data section */ . = ALIGN(8192); /* init_task */ .data.init_task : { *(.data.init_task) } . = ALIGN(4096); /* Init code and data */ __init_begin = .; .text.init : { *(.text.init) } .data.init : { *(.data.init) } . = ALIGN(4096); __init_end = .; __setup_start = .; .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; .initcall.init : { *(.initcall.init) } __initcall_end = .; . = ALIGN(4096); __init_end = .; . = ALIGN(32); .data.cacheline_aligned : { *(.data.cacheline_aligned) } . = ALIGN(4096); .data.page_aligned : { *(.data.idt) } __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) } } Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390/Makefile,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- Makefile 25 Feb 2001 23:15:22 -0000 1.1.1.2 +++ Makefile 9 Apr 2002 17:03:16 -0000 1.2 @@ -17,7 +17,11 @@ CPP=$(CC) -E OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S LDFLAGS=-e start +ifeq ($(CONFIG_SHARED_KERNEL),y) +LINKFLAGS =-T $(TOPDIR)/arch/s390/vmlinux-shared.lds $(LDFLAGS) +else LINKFLAGS =-T $(TOPDIR)/arch/s390/vmlinux.lds $(LDFLAGS) +endif CFLAGS_PIPE := -pipe CFLAGS_NSR := -fno-strength-reduce @@ -26,11 +30,15 @@ HEAD := arch/s390/kernel/head.o arch/s390/kernel/init_task.o SUBDIRS := $(SUBDIRS) arch/s390/mm arch/s390/kernel arch/s390/lib \ - drivers/s390 -CORE_FILES := arch/s390/mm/mm.o arch/s390/kernel/kernel.o $(CORE_FILES) \ - drivers/s390/io.o + drivers/s390 arch/s390/math-emu +CORE_FILES := arch/s390/mm/mm.o arch/s390/kernel/kernel.o $(CORE_FILES) +DRIVERS := $(DRIVERS) drivers/s390/io.o LIBS := $(TOPDIR)/arch/s390/lib/lib.a $(LIBS) $(TOPDIR)/arch/s390/lib/lib.a +ifeq ($(CONFIG_MATHEMU),y) + CORE_FILES := $(CORE_FILES) arch/s390/math-emu/math-emu.o +endif + all: image listing listing: vmlinux @@ -46,16 +54,6 @@ $(MAKE) linuxsubdirs SUBDIRS=drivers/s390 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot - -MAKESILO = $(MAKE) -C arch/$(ARCH)/tools/silo - -MAKEDASDFMT = $(MAKE) -C arch/$(ARCH)/tools/dasdfmt - -silo: - @$(MAKESILO) silo - -dasdfmt: - @$(MAKEDASDFMT) dasdfmt image: vmlinux @$(MAKEBOOT) image Index: config.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390/config.in,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- config.in 25 Feb 2001 23:15:22 -0000 1.1.1.2 +++ config.in 9 Apr 2002 17:03:16 -0000 1.2 @@ -7,6 +7,9 @@ define_bool CONFIG_EISA n define_bool CONFIG_MCA n define_bool CONFIG_UID16 y +define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y +define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n +define_bool CONFIG_GENERIC_BUST_SPINLOCK n mainmenu_name "Linux Kernel Configuration" define_bool CONFIG_ARCH_S390 y @@ -28,7 +31,7 @@ mainmenu_option next_comment comment 'Processor type and features' bool 'Symmetric multi-processing support' CONFIG_SMP -bool 'IEEE FPU emulation' CONFIG_IEEEFPU_EMULATION +bool 'IEEE FPU emulation' CONFIG_MATHEMU endmenu mainmenu_option next_comment @@ -44,10 +47,12 @@ bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT bool 'Sysctl support' CONFIG_SYSCTL -define CONFIG_KCORE ELF +define_bool CONFIG_KCORE_ELF y tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC bool 'Show crashed user process info' CONFIG_PROCESS_DEBUG +bool 'Pseudo page fault support' CONFIG_PFAULT +bool 'VM shared kernel support' CONFIG_SHARED_KERNEL endmenu source drivers/s390/Config.in @@ -65,6 +70,6 @@ if [ "$CONFIG_CTC" = "y" ]; then bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG fi -# this does not work. bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ +bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ endmenu Index: defconfig =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390/defconfig,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- defconfig 25 Feb 2001 23:15:22 -0000 1.1.1.2 +++ defconfig 9 Apr 2002 17:03:16 -0000 1.2 @@ -1,10 +1,13 @@ # -# Automatically generated by make menuconfig: don't edit +# Automatically generated make config: don't edit # # CONFIG_ISA is not set # CONFIG_EISA is not set # CONFIG_MCA is not set CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_GENERIC_BUST_SPINLOCK=n CONFIG_ARCH_S390=y # @@ -13,12 +16,6 @@ CONFIG_EXPERIMENTAL=y # -# Processor type and features -# -CONFIG_SMP=y -CONFIG_IEEEFPU_EMULATION=y - -# # Loadable module support # CONFIG_MODULES=y @@ -26,6 +23,12 @@ CONFIG_KMOD=y # +# Processor type and features +# +CONFIG_SMP=y +CONFIG_MATHEMU=y + +# # General setup # CONFIG_FAST_IRQ=y @@ -36,9 +39,12 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +CONFIG_KCORE_ELF=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set # CONFIG_PROCESS_DEBUG is not set +CONFIG_PFAULT=y +# CONFIG_SHARED_KERNEL is not set # # Block device drivers @@ -49,9 +55,14 @@ CONFIG_BLK_DEV_RAM_SIZE=24576 CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_XPRAM=m + +# +# S/390 block device drivers +# CONFIG_DASD=y CONFIG_DASD_ECKD=y CONFIG_DASD_FBA=y +# CONFIG_DASD_DIAG is not set # # Multi-device support (RAID and LVM) @@ -62,21 +73,36 @@ CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID5=m +# CONFIG_MD_MULTIPATH is not set CONFIG_BLK_DEV_LVM=m -CONFIG_LVM_PROC_FS=y # # Character device drivers # CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 -CONFIG_3215=y -CONFIG_3215_CONSOLE=y + +# +# S/390 character device drivers +# +CONFIG_TN3270=y +CONFIG_TN3270_CONSOLE=y +CONFIG_TN3215=y +CONFIG_TN3215_CONSOLE=y CONFIG_HWC=y CONFIG_HWC_CONSOLE=y +CONFIG_HWC_CPI=m CONFIG_S390_TAPE=m + +# +# S/390 tape interface support +# CONFIG_S390_TAPE_CHAR=y CONFIG_S390_TAPE_BLOCK=y + +# +# S/390 tape hardware support +# CONFIG_S390_TAPE_3490=y CONFIG_S390_TAPE_3480=y @@ -85,10 +111,18 @@ # CONFIG_NETDEVICES=y # CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set CONFIG_NET_ETHERNET=y CONFIG_TR=y # CONFIG_FDDI is not set -# CONFIG_CHANDEV is not set + +# +# S/390 network device drivers +# +CONFIG_CHANDEV=y +CONFIG_HOTPLUG=y CONFIG_CTC=m CONFIG_IUCV=m @@ -109,11 +143,17 @@ # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set # CONFIG_INET_ECN is not set # CONFIG_SYN_COOKIES is not set -# CONFIG_IPV6 is not set +CONFIG_IPV6=m +# CONFIG_IPV6_NETLINK is not set # CONFIG_KHTTPD is not set # CONFIG_ATM is not set + +# +# +# # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_DECNET is not set @@ -138,28 +178,38 @@ # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set # CONFIG_ADFS_FS is not set # CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set +# CONFIG_CMS_FS is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_JBD_DEBUG is not set # CONFIG_FAT_FS is not set # CONFIG_MSDOS_FS is not set # CONFIG_UMSDOS_FS is not set # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_TMPFS is not set # CONFIG_RAMFS is not set # CONFIG_ISO9660_FS is not set # CONFIG_JOLIET is not set +# CONFIG_ZISOFS is not set # CONFIG_MINIX_FS is not set +# CONFIG_FREEVXFS_FS is not set # CONFIG_NTFS_FS is not set # CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y -# CONFIG_DEVFS_FS is not set -# CONFIG_DEVFS_MOUNT is not set +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set @@ -167,7 +217,6 @@ # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set -# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set # CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set @@ -177,6 +226,7 @@ # Network File Systems # # CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set CONFIG_NFS_FS=y # CONFIG_NFS_V3 is not set # CONFIG_ROOT_NFS is not set @@ -192,10 +242,10 @@ # CONFIG_NCPFS_NFS_NS is not set # CONFIG_NCPFS_OS2_NS is not set # CONFIG_NCPFS_SMALLDOS is not set -# CONFIG_NCPFS_MOUNT_SUBDIR is not set -# CONFIG_NCPFS_NDS_DOMAINS is not set # CONFIG_NCPFS_NLS is not set # CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set +# CONFIG_ZLIB_FS_INFLATE is not set # # Partition Types @@ -208,11 +258,14 @@ CONFIG_IBM_PARTITION=y # CONFIG_MAC_PARTITION is not set # CONFIG_MSDOS_PARTITION is not set +# CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set +# CONFIG_SMB_NLS is not set # CONFIG_NLS is not set # # Kernel hacking # +CONFIG_MAGIC_SYSRQ=y Index: vmlinux.lds =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390/vmlinux.lds,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- vmlinux.lds 25 Feb 2001 23:15:22 -0000 1.1.1.2 +++ vmlinux.lds 9 Apr 2002 17:03:16 -0000 1.2 @@ -14,7 +14,7 @@ *(.gnu.warning) } = 0x0700 .text.lock : { *(.text.lock) } /* out-of-line lock text */ - .rodata : { *(.rodata) } + .rodata : { *(.rodata) *(.rodata.*) } .kstrtab : { *(.kstrtab) } . = ALIGN(16); /* Exception table */ |
From: Andy P. <at...@us...> - 2002-04-09 17:08:27
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/cris/lib In directory usw-pr-cvs1:/tmp/cvs-serv13825/cris/lib Modified Files: Makefile checksum.S checksumcopy.S dmacopy.c memset.c old_checksum.c string.c usercopy.c Added Files: csumcpfruser.S dram_init.S hw_settings.S Log Message: synch 2.4.15 commit 29 --- NEW FILE --- /* * Add-on to transform csum_partial_copy_nocheck in checksumcopy.S into * csum_partial_copy_from_user by adding exception records. * * Copyright (C) 2001 Axis Communications AB. * * Author: Hans-Peter Nilsson. */ #include <asm/errno.h> /* Same function body, but a different name. If we just added exception records to _csum_partial_copy_nocheck and made it generic, we wouldn't know a user fault from a kernel fault and we would have overhead in each kernel caller for the error-pointer argument. unsigned int csum_partial_copy_from_user (const char *src, char *dst, int len, unsigned int sum, int *errptr); Note that the errptr argument is only set if we encounter an error. It is conveniently located on the stack, so the normal function body does not have to handle it. */ #define csum_partial_copy_nocheck csum_partial_copy_from_user /* There are local labels numbered 1, 2 and 3 present to mark the different from-user accesses. */ #include "checksumcopy.S" .section .fixup,"ax" ;; Here from the movem loop; restore stack. 4: movem [$sp+],$r8 ;; r12 is already decremented. Add back chunk_size-2. addq 40-2,$r12 ;; Here from the word loop; r12 is off by 2; add it back. 5: addq 2,$r12 ;; Here from a failing single byte. 6: ;; Signal in *errptr that we had a failing access. moveq -EFAULT,$r9 move.d $r9,[[$sp]] ;; Clear the rest of the destination area using memset. Preserve the ;; checksum for the readable bytes. push $srp push $r13 move.d $r11,$r10 clear.d $r11 jsr memset pop $r10 jump [$sp+] .previous .section __ex_table,"a" .dword 1b,4b .dword 2b,5b .dword 3b,6b .previous --- NEW FILE --- /* $Id: dram_init.S,v 1.1 2002/04/09 17:03:16 atp Exp $ * * DRAM/SDRAM initialization - alter with care * This file is intended to be included from other assembler files * * Note: This file may not modify r9 because r9 is used to carry * information from the decompresser to the kernel * * Copyright (C) 2000, 2001 Axis Communications AB * * Authors: Mikael Starvik (st...@ax...) * * $Log: dram_init.S,v $ * Revision 1.1 2002/04/09 17:03:16 atp * synch 2.4.15 commit 29 * * Revision 1.10 2001/10/04 12:00:21 martinnn * Added missing underscores. * * Revision 1.9 2001/10/01 14:47:35 bjornw * Added register prefixes and removed underscores * * Revision 1.8 2001/05/15 07:12:45 hp * Copy warning from head.S about r8 and r9 * * Revision 1.7 2001/04/18 12:05:39 bjornw * Fixed comments, and explicitely include config.h to be sure its there * * Revision 1.6 2001/04/10 06:20:16 starvik * Delay should be 200us, not 200ns * * Revision 1.5 2001/04/09 06:01:13 starvik * Added support for 100 MHz SDRAMs * * Revision 1.4 2001/03/26 14:24:01 bjornw * Namechange of some config options * * Revision 1.3 2001/03/23 08:29:41 starvik * Corrected calculation of mrs_data * * Revision 1.2 2001/02/08 15:20:00 starvik * Corrected SDRAM initialization * Should now be included as inline * * Revision 1.1 2001/01/29 13:08:02 starvik * Initial version * This file should be included from all assembler files that needs to * initialize DRAM/SDRAM. * */ /* Just to be certain the config file is included, we include it here * explicitely instead of depending on it being included in the file that * uses this code. */ #include <linux/config.h> ;; WARNING! The registers r8 and r9 are used as parameters carrying ;; information from the decompressor (if the kernel was compressed). ;; They should not be used in the code below. #ifndef CONFIG_SVINTO_SIM move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0 move.d $r0, [R_WAITSTATES] move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0 move.d $r0, [R_BUS_CONFIG] #ifndef CONFIG_ETRAX_SDRAM move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0 move.d $r0, [R_DRAM_CONFIG] move.d CONFIG_ETRAX_DEF_R_DRAM_TIMING, $r0 move.d $r0, [R_DRAM_TIMING] #else ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization ; Bank configuration move.d CONFIG_ETRAX_DEF_R_SDRAM_CONFIG, $r0 move.d $r0, [R_SDRAM_CONFIG] ; Calculate value of mrs_data ; CAS latency = 2 && bus_width = 32 => 0x40 ; CAS latency = 3 && bus_width = 32 => 0x60 ; CAS latency = 2 && bus_width = 16 => 0x20 ; CAS latency = 3 && bus_width = 16 => 0x30 move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2 move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1 move.d $r1, $r3 and.d 0x03, $r1 ; Get CAS latency and.d 0x1000, $r3 ; 50 or 100 MHz? beq _speed_50 nop _speed_100: cmp.d 0x00, $r1 ; CAS latency = 2? beq _bw_check nop or.d 0x20, $r2 ; CAS latency = 3 ba _bw_check nop _speed_50: cmp.d 0x01, $r1 ; CAS latency = 2? beq _bw_check nop or.d 0x20, $r2 ; CAS latency = 3 _bw_check: move.d CONFIG_ETRAX_DEF_R_SDRAM_CONFIG, $r1 and.d 0x800000, $r1 ; DRAM width is bit 23 bne _set_timing nop lsrq 1, $r2 ; 16 bits. Shift down value. ; Set timing parameters. Starts master clock _set_timing: move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1 and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0 or.d 0x80000000, $r1 ; Make sure sdram enable bit is set move.d $r1, $r5 or.d 0x0000c000, $r1 ; ref = disable lslq 16, $r2 ; mrs data starts at bit 16 or.d $r2, $r1 move.d $r1, [R_SDRAM_TIMING] ; Wait 200us move.d 10000, $r2 1: bne 1b subq 1, $r2 ; Issue initialization command sequence move.d _sdram_commands_start, $r2 move.d _sdram_commands_end, $r3 1: clear.d $r4 move.b [$r2+], $r4 lslq 9, $r4 ; Command starts at bit 9 or.d $r1, $r4 move.d $r4, [R_SDRAM_TIMING] nop ; Wait five nop cycles between each command nop nop nop nop cmp.d $r2, $r3 bne 1b nop move.d $r5, [R_SDRAM_TIMING] ba _sdram_commands_end nop _sdram_commands_start: .byte 3 ; Precharge .byte 0 ; nop .byte 2 ; refresh .byte 0 ; nop .byte 2 ; refresh .byte 0 ; nop .byte 2 ; refresh .byte 0 ; nop .byte 2 ; refresh .byte 0 ; nop .byte 2 ; refresh .byte 0 ; nop .byte 2 ; refresh .byte 0 ; nop .byte 2 ; refresh .byte 0 ; nop .byte 2 ; refresh .byte 0 ; nop .byte 1 ; mrs .byte 0 ; nop _sdram_commands_end: #endif #endif --- NEW FILE --- /* * $Id: hw_settings.S,v 1.1 2002/04/09 17:03:16 atp Exp $ * * This table is used by some tools to extract hardware parameters. * The table should be included in the kernel and the decompressor. * Don't forget to update the tools if you change this table. * * Copyright (C) 2001 Axis Communications AB * * Authors: Mikael Starvik (st...@ax...) */ #define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \ (CONFIG_ETRAX_DEF_R_PORT_PA_DATA)) #define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \ (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \ (CONFIG_ETRAX_DEF_R_PORT_PB_DATA)) .ascii "HW_PARAM_MAGIC" ; Magic number .dword 0xc0004000 ; Kernel start address ; Debug port #ifdef CONFIG_ETRAX_DEBUG_PORT0 .dword 0 #elif defined(CONFIG_ETRAX_DEBUG_PORT1) .dword 1 #elif defined(CONFIG_ETRAX_DEBUG_PORT2) .dword 2 #elif defined(CONFIG_ETRAX_DEBUG_PORT3) .dword 3 #else .dword 4 ; No debug #endif ; SDRAM or EDO DRAM? #ifdef CONFIG_ETRAX_SDRAM .dword 1 #else .dword 0 #endif ; Register values .dword R_WAITSTATES .dword CONFIG_ETRAX_DEF_R_WAITSTATES .dword R_BUS_CONFIG .dword CONFIG_ETRAX_DEF_R_BUS_CONFIG #ifdef CONFIG_ETRAX_SDRAM .dword R_SDRAM_CONFIG .dword CONFIG_ETRAX_DEF_R_SDRAM_CONFIG .dword R_SDRAM_TIMING .dword CONFIG_ETRAX_DEF_R_SDRAM_TIMING #else .dword R_DRAM_CONFIG .dword CONFIG_ETRAX_DEF_R_DRAM_CONFIG .dword R_DRAM_TIMING .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING #endif .dword R_PORT_PA_SET .dword PA_SET_VALUE .dword R_PORT_PB_SET .dword PB_SET_VALUE .dword 0 ; No more register values Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/lib/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ Makefile 9 Apr 2002 17:03:16 -0000 1.2 @@ -6,6 +6,6 @@ $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o L_TARGET = lib.a -obj-y = checksum.o checksumcopy.o string.o usercopy.o memset.o +obj-y = checksum.o checksumcopy.o string.o usercopy.o memset.o csumcpfruser.o include $(TOPDIR)/Rules.make Index: checksum.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/lib/checksum.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- checksum.S 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ checksum.S 9 Apr 2002 17:03:16 -0000 1.2 @@ -1,113 +1,124 @@ - ;; $Id$ - ;; A fast checksum routine using movem - ;; Copyright (c) 1998 Bjorn Wesen/Axis Communications AB +/* $Id$ + * A fast checksum routine using movem + * Copyright (c) 1998-2001 Axis Communications AB + * + * csum_partial(const unsigned char * buff, int len, unsigned int sum) + */ - ;; csum_partial(const unsigned char * buff, int len, unsigned int sum) - - .globl _csum_partial -_csum_partial: + .globl csum_partial +csum_partial: + ;; r10 - src + ;; r11 - length + ;; r12 - checksum + ;; check for breakeven length between movem and normal word looping versions + ;; we also do _NOT_ want to compute a checksum over more than the + ;; actual length when length < 40 - cmpu.w 80,r11 - bcs no_movem + cmpu.w 80,$r11 + blo _word_loop nop ;; need to save the registers we use below in the movem loop ;; this overhead is why we have a check above for breakeven length + ;; only r0 - r8 have to be saved, the other ones are clobber-able + ;; according to the ABI - subq 9*4,sp - movem r8,[sp] + subq 9*4,$sp + movem $r8,[$sp] ;; do a movem checksum - ;; r10 - src - ;; r11 - length - ;; r12 - checksum - - subq 10*4,r11 ; update length for the first loop + subq 10*4,$r11 ; update length for the first loop -mloop: movem [r10+],r9 ; read 10 longwords +_mloop: movem [$r10+],$r9 ; read 10 longwords ;; perform dword checksumming on the 10 longwords - add.d r0,r12 + add.d $r0,$r12 ax - add.d r1,r12 + add.d $r1,$r12 ax - add.d r2,r12 + add.d $r2,$r12 ax - add.d r3,r12 + add.d $r3,$r12 ax - add.d r4,r12 + add.d $r4,$r12 ax - add.d r5,r12 + add.d $r5,$r12 ax - add.d r6,r12 + add.d $r6,$r12 ax - add.d r7,r12 + add.d $r7,$r12 ax - add.d r8,r12 + add.d $r8,$r12 ax - add.d r9,r12 + add.d $r9,$r12 ;; fold the carry into the checksum, to avoid having to loop the carry ;; back into the top ax - addq 0,r12 + addq 0,$r12 ax ; do it again, since we might have generated a carry - addq 0,r12 + addq 0,$r12 - subq 10*4,r11 - bge mloop + subq 10*4,$r11 + bge _mloop nop - addq 10*4,r11 ; compensate for last loop underflowing length + addq 10*4,$r11 ; compensate for last loop underflowing length - ;; fold 32-bit checksum into a 16-bit checksum, to avoid carries below - - moveq -1,r1 ; put 0xffff in r1, faster than move.d 0xffff,r1 - lsrq 16,r1 - - move.d r12,r0 - lsrq 16,r0 ; r0 = checksum >> 16 - and.d r1,r12 ; checksum = checksum & 0xffff - add.d r0,r12 ; checksum += r0 - move.d r12,r0 ; do the same again, maybe we got a carry last add - lsrq 16,r0 - and.d r1,r12 - add.d r0,r12 - - movem [sp+],r8 ; restore regs - -no_movem: - cmpq 2,r11 - blt no_words + movem [$sp+],$r8 ; restore regs + +_word_loop: + ;; only fold if there is anything to fold. + + cmpq 0,$r12 + beq _no_fold + + ;; fold 32-bit checksum into a 16-bit checksum, to avoid carries below. + ;; r9 and r13 can be used as temporaries. + + moveq -1,$r9 ; put 0xffff in r9, faster than move.d 0xffff,r9 + lsrq 16,$r9 + + move.d $r12,$r13 + lsrq 16,$r13 ; r13 = checksum >> 16 + and.d $r9,$r12 ; checksum = checksum & 0xffff + add.d $r13,$r12 ; checksum += r13 + move.d $r12,$r13 ; do the same again, maybe we got a carry last add + lsrq 16,$r13 + and.d $r9,$r12 + add.d $r13,$r12 + +_no_fold: + cmpq 2,$r11 + blt _no_words nop ;; checksum the rest of the words - subq 2,r11 + subq 2,$r11 -wloop: subq 2,r11 - bge wloop - addu.w [r10+],r12 +_wloop: subq 2,$r11 + bge _wloop + addu.w [$r10+],$r12 - addq 2,r11 + addq 2,$r11 -no_words: +_no_words: ;; see if we have one odd byte more - cmpq 1,r11 - beq do_byte + cmpq 1,$r11 + beq _do_byte nop ret - move.d r12, r10 + move.d $r12, $r10 -do_byte: +_do_byte: ;; copy and checksum the last byte - addu.b [r10],r12 + addu.b [$r10],$r12 ret - move.d r12, r10 + move.d $r12, $r10 - \ No newline at end of file Index: checksumcopy.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/lib/checksumcopy.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- checksumcopy.S 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ checksumcopy.S 9 Apr 2002 17:03:16 -0000 1.2 @@ -1,120 +1,132 @@ - ;; $Id$ - ;; A fast checksum+copy routine using movem - ;; Copyright (c) 1998, 2000 Axis Communications AB - ;; - ;; Authors: Bjorn Wesen - ;; - ;; csum_partial_copy_nocheck(const char *src, char *dst, - ;; int len, unsigned int sum) +/* $Id$ + * A fast checksum+copy routine using movem + * Copyright (c) 1998, 2001 Axis Communications AB + * + * Authors: Bjorn Wesen + * + * csum_partial_copy_nocheck(const char *src, char *dst, + * int len, unsigned int sum) + */ - .globl _csum_partial_copy_nocheck -_csum_partial_copy_nocheck: + .globl csum_partial_copy_nocheck +csum_partial_copy_nocheck: + ;; r10 - src + ;; r11 - dst + ;; r12 - length + ;; r13 - checksum + ;; check for breakeven length between movem and normal word looping versions + ;; we also do _NOT_ want to compute a checksum over more than the + ;; actual length when length < 40 - cmpu.w 80,r12 - bcs no_movem + cmpu.w 80, $r12 + blo _word_loop nop ;; need to save the registers we use below in the movem loop ;; this overhead is why we have a check above for breakeven length + ;; only r0 - r8 have to be saved, the other ones are clobber-able + ;; according to the ABI - subq 9*4,sp - movem r8,[sp] + subq 9*4, $sp + movem $r8, [$sp] ;; do a movem copy and checksum - ;; r10 - src - ;; r11 - dst - ;; r12 - length - ;; r13 - checksum - - subq 10*4,r12 ; update length for the first loop + subq 10*4, $r12 ; update length for the first loop -mloop: movem [r10+],r9 ; read 10 longwords - movem r9,[r11+] ; write 10 longwords +_mloop: movem [$r10+],$r9 ; read 10 longwords +1: ;; A failing userspace access will have this as PC. + movem $r9,[$r11+] ; write 10 longwords ;; perform dword checksumming on the 10 longwords - add.d r0,r13 + add.d $r0,$r13 ax - add.d r1,r13 + add.d $r1,$r13 ax - add.d r2,r13 + add.d $r2,$r13 ax - add.d r3,r13 + add.d $r3,$r13 ax - add.d r4,r13 + add.d $r4,$r13 ax - add.d r5,r13 + add.d $r5,$r13 ax - add.d r6,r13 + add.d $r6,$r13 ax - add.d r7,r13 + add.d $r7,$r13 ax - add.d r8,r13 + add.d $r8,$r13 ax - add.d r9,r13 + add.d $r9,$r13 ;; fold the carry into the checksum, to avoid having to loop the carry ;; back into the top ax - addq 0,r13 + addq 0,$r13 + ax ; do it again, since we might have generated a carry + addq 0,$r13 - subq 10*4,r12 - bge mloop + subq 10*4,$r12 + bge _mloop nop - addq 10*4,r12 ; compensate for last loop underflowing length + addq 10*4,$r12 ; compensate for last loop underflowing length + + movem [$sp+],$r8 ; restore regs + +_word_loop: + ;; only fold if there is anything to fold. + + cmpq 0,$r13 + beq _no_fold ;; fold 32-bit checksum into a 16-bit checksum, to avoid carries below + ;; r9 can be used as temporary. - moveq -1,r1 ; put 0xffff in r1, faster than move.d 0xffff,r1 - lsrq 16,r1 - - move.d r13,r0 - lsrq 16,r0 ; r0 = checksum >> 16 - and.d r1,r13 ; checksum = checksum & 0xffff - add.d r0,r13 ; checksum += r0 - move.d r13,r0 ; do the same again, maybe we got a carry last add - lsrq 16,r0 - and.d r1,r13 - add.d r0,r13 - - movem [sp+],r8 ; restore regs - -no_movem: - cmpq 2,r12 - blt no_words + move.d $r13,$r9 + lsrq 16,$r9 ; r0 = checksum >> 16 + and.d 0xffff,$r13 ; checksum = checksum & 0xffff + add.d $r9,$r13 ; checksum += r0 + move.d $r13,$r9 ; do the same again, maybe we got a carry last add + lsrq 16,$r9 + and.d 0xffff,$r13 + add.d $r9,$r13 + +_no_fold: + cmpq 2,$r12 + blt _no_words nop ;; copy and checksum the rest of the words - subq 2,r12 + subq 2,$r12 -wloop: move.w [r10+],r9 - addu.w r9,r13 - subq 2,r12 - bge wloop - move.w r9,[r11+] +_wloop: move.w [$r10+],$r9 +2: ;; A failing userspace access will have this as PC. + addu.w $r9,$r13 + subq 2,$r12 + bge _wloop + move.w $r9,[$r11+] - addq 2,r12 + addq 2,$r12 -no_words: +_no_words: ;; see if we have one odd byte more - cmpq 1,r12 - beq do_byte + cmpq 1,$r12 + beq _do_byte nop ret - move.d r13, r10 + move.d $r13, $r10 -do_byte: +_do_byte: ;; copy and checksum the last byte - move.b [r10],r9 - addu.b r9,r13 - move.b r9,[r11] + move.b [$r10],$r9 +3: ;; A failing userspace access will have this as PC. + addu.b $r9,$r13 + move.b $r9,[$r11] ret - move.d r13, r10 - - \ No newline at end of file + move.d $r13, $r10 Index: dmacopy.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/lib/dmacopy.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: memset.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/lib/memset.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- memset.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ memset.c 9 Apr 2002 17:03:16 -0000 1.2 @@ -27,6 +27,8 @@ /*# */ /*#-------------------------------------------------------------------------*/ +#include <linux/types.h> + /* No, there's no macro saying 12*4, since it is "hard" to get it into the asm in a good way. Thus better to expose the problem everywhere. */ @@ -39,7 +41,7 @@ void *memset(void *pdst, int c, - unsigned int plen) + size_t plen) { /* Ok. Now we want the parameters put in special registers. Make sure the compiler is able to make something useful of this. */ @@ -54,7 +56,12 @@ /* Ugh. This is fragile at best. Check with newer GCC releases, if they compile cascaded "x |= x << 8" sanely! */ - __asm__("movu.b %0,r13\n\tlslq 8,r13\n\tmove.b %0,r13\n\tmove.d r13,%0\n\tlslq 16,r13\n\tor.d r13,%0" + __asm__("movu.b %0,$r13\n\t" + "lslq 8,$r13\n\t" + "move.b %0,$r13\n\t" + "move.d $r13,%0\n\t" + "lslq 16,$r13\n\t" + "or.d $r13,%0" : "=r" (lc) : "0" (lc) : "r13"); { @@ -111,36 +118,36 @@ ;; Save the registers we'll clobber in the movem process ;; on the stack. Don't mention them to gcc, it will only be ;; upset. - subq 11*4,sp - movem r10,[sp] + subq 11*4,$sp + movem $r10,[$sp] - move.d r11,r0 - move.d r11,r1 - move.d r11,r2 - move.d r11,r3 - move.d r11,r4 - move.d r11,r5 - move.d r11,r6 - move.d r11,r7 - move.d r11,r8 - move.d r11,r9 - move.d r11,r10 + move.d $r11,$r0 + move.d $r11,$r1 + move.d $r11,$r2 + move.d $r11,$r3 + move.d $r11,$r4 + move.d $r11,$r5 + move.d $r11,$r6 + move.d $r11,$r7 + move.d $r11,$r8 + move.d $r11,$r9 + move.d $r11,$r10 ;; Now we've got this: ;; r13 - dst ;; r12 - n ;; Update n for the first loop - subq 12*4,r12 + subq 12*4,$r12 0: - subq 12*4,r12 + subq 12*4,$r12 bge 0b - movem r11,[r13+] + movem $r11,[$r13+] - addq 12*4,r12 ;; compensate for last loop underflowing n + addq 12*4,$r12 ;; compensate for last loop underflowing n ;; Restore registers from stack - movem [sp+],r10" + movem [$sp+],$r10" /* Outputs */ : "=r" (dst), "=r" (n) /* Inputs */ : "0" (dst), "1" (n), "r" (lc)); Index: old_checksum.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/lib/old_checksum.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: string.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/lib/string.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- string.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ string.c 9 Apr 2002 17:03:16 -0000 1.2 @@ -31,9 +31,11 @@ /*# */ /*#-------------------------------------------------------------------------*/ +#include <linux/types.h> + void *memcpy(void *pdst, const void *psrc, - unsigned int pn) + size_t pn) { /* Ok. Now we want the parameters put in special registers. Make sure the compiler is able to make something useful of this. @@ -100,8 +102,8 @@ ;; ;; Save the registers we'll use in the movem process ;; on the stack. - subq 11*4,sp - movem r10,[sp] + subq 11*4,$sp + movem $r10,[$sp] ;; Now we've got this: ;; r11 - src @@ -109,17 +111,17 @@ ;; r12 - n ;; Update n for the first loop - subq 44,r12 + subq 44,$r12 0: - movem [r11+],r10 - subq 44,r12 + movem [$r11+],$r10 + subq 44,$r12 bge 0b - movem r10,[r13+] + movem $r10,[$r13+] - addq 44,r12 ;; compensate for last loop underflowing n + addq 44,$r12 ;; compensate for last loop underflowing n ;; Restore registers from stack - movem [sp+],r10" + movem [$sp+],$r10" /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n) /* Inputs */ : "0" (dst), "1" (src), "2" (n)); Index: usercopy.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/lib/usercopy.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- usercopy.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ usercopy.c 9 Apr 2002 17:03:16 -0000 1.2 @@ -95,8 +95,8 @@ ;; ;; Save the registers we'll use in the movem process ;; on the stack. - subq 11*4,sp - movem r10,[sp] + subq 11*4,$sp + movem $r10,[$sp] ;; Now we've got this: ;; r11 - src @@ -104,7 +104,7 @@ ;; r12 - n ;; Update n for the first loop - subq 44,r12 + subq 44,$r12 ; Since the noted PC of a faulting instruction in a delay-slot of a taken ; branch, is that of the branch target, we actually point at the from-movem @@ -113,15 +113,15 @@ ; after *that* movem. 0: - movem [r11+],r10 - subq 44,r12 + movem [$r11+],$r10 + subq 44,$r12 bge 0b - movem r10,[r13+] + movem $r10,[$r13+] 1: - addq 44,r12 ;; compensate for last loop underflowing n + addq 44,$r12 ;; compensate for last loop underflowing n ;; Restore registers from stack - movem [sp+],r10 + movem [$sp+],$r10 2: .section .fixup,\"ax\" @@ -130,14 +130,14 @@ ; performance penalty for sany use; the program will segfault soon enough. 3: - move.d [sp],r10 - addq 44,r10 - move.d r10,[sp] + move.d [$sp],$r10 + addq 44,$r10 + move.d $r10,[$sp] jump 0b 4: - movem [sp+],r10 - addq 44,r10 - addq 44,r12 + movem [$sp+],$r10 + addq 44,$r10 + addq 44,$r12 jump 2b .previous @@ -255,8 +255,8 @@ ;; ;; Save the registers we'll use in the movem process ;; on the stack. - subq 11*4,sp - movem r10,[sp] + subq 11*4,$sp + movem $r10,[$sp] ;; Now we've got this: ;; r11 - src @@ -264,42 +264,82 @@ ;; r12 - n ;; Update n for the first loop - subq 44,r12 + subq 44,$r12 0: - movem [r11+],r10 + movem [$r11+],$r10 1: - subq 44,r12 + subq 44,$r12 bge 0b - movem r10,[r13+] - - addq 44,r12 ;; compensate for last loop underflowing n + movem $r10,[$r13+] + addq 44,$r12 ;; compensate for last loop underflowing n +8: ;; Restore registers from stack - movem [sp+],r10 + movem [$sp+],$r10 .section .fixup,\"ax\" -; To provide a correct count in r10 of bytes that failed to be copied, -; we jump back into the loop if the loop-branch was taken. -; There is no performance penalty; the program will segfault soon -; enough. +;; Do not jump back into the loop if we fail. For some uses, we get a +;; page fault but for performance reasons we care to not get further +;; faults. For example, fs/super.c at one time did +;; i = size - copy_from_user((void *)page, data, size); +;; which would cause repeated faults while clearing the remainder of +;; the SIZE bytes at PAGE after the first fault. 3: - move.d [sp],r10 - addq 44,r10 - move.d r10,[sp] - clear.d r0 - clear.d r1 - clear.d r2 - clear.d r3 - clear.d r4 - clear.d r5 - clear.d r6 - clear.d r7 - clear.d r8 - clear.d r9 - clear.d r10 - jump 1b + move.d [$sp],$r10 + +;; Number of remaining bytes, cleared but not copied, is r12 + 44. + + add.d $r12,$r10 + addq 44,$r10 + + move.d $r10,[$sp] + clear.d $r0 + clear.d $r1 + clear.d $r2 + clear.d $r3 + clear.d $r4 + clear.d $r5 + clear.d $r6 + clear.d $r7 + clear.d $r8 + clear.d $r9 + clear.d $r10 + +;; Perform clear similar to the copy-loop. + +4: + subq 44,$r12 + bge 4b + movem $r10,[$r13+] + +;; Clear by four for the remaining multiples. + + addq 40,$r12 + bmi 6f + nop +5: + subq 4,$r12 + bpl 5b + clear.d [$r13+] +6: + addq 4,$r12 + beq 7f + nop + + subq 1,$r12 + beq 7f + clear.b [$r13+] + + subq 1,$r12 + beq 7f + clear.b [$r13+] + + clear.d $r12 + clear.b [$r13+] +7: + jump 8b .previous .section __ex_table,\"a\" @@ -411,50 +451,50 @@ ;; Save the registers we'll clobber in the movem process ;; on the stack. Don't mention them to gcc, it will only be ;; upset. - subq 11*4,sp - movem r10,[sp] + subq 11*4,$sp + movem $r10,[$sp] - clear.d r0 - clear.d r1 - clear.d r2 - clear.d r3 - clear.d r4 - clear.d r5 - clear.d r6 - clear.d r7 - clear.d r8 - clear.d r9 - clear.d r10 - clear.d r11 + clear.d $r0 + clear.d $r1 + clear.d $r2 + clear.d $r3 + clear.d $r4 + clear.d $r5 + clear.d $r6 + clear.d $r7 + clear.d $r8 + clear.d $r9 + clear.d $r10 + clear.d $r11 ;; Now we've got this: ;; r13 - dst ;; r12 - n ;; Update n for the first loop - subq 12*4,r12 + subq 12*4,$r12 0: - subq 12*4,r12 + subq 12*4,$r12 bge 0b - movem r11,[r13+] + movem $r11,[$r13+] 1: - addq 12*4,r12 ;; compensate for last loop underflowing n + addq 12*4,$r12 ;; compensate for last loop underflowing n ;; Restore registers from stack - movem [sp+],r10 + movem [$sp+],$r10 2: .section .fixup,\"ax\" 3: - move.d [sp],r10 - addq 12*4,r10 - move.d r10,[sp] - clear.d r10 + move.d [$sp],$r10 + addq 12*4,$r10 + move.d $r10,[$sp] + clear.d $r10 jump 0b 4: - movem [sp+],r10 - addq 12*4,r10 - addq 12*4,r12 + movem [$sp+],$r10 + addq 12*4,$r10 + addq 12*4,$r12 jump 2b .previous |
From: Andy P. <at...@us...> - 2002-04-09 17:08:26
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/cris/mm In directory usw-pr-cvs1:/tmp/cvs-serv13825/cris/mm Modified Files: Makefile extable.c fault.c init.c tlb.c Added Files: ioremap.c Log Message: synch 2.4.15 commit 29 --- NEW FILE --- /* * arch/cris/mm/ioremap.c * * Re-map IO memory to kernel address space so that we can access it. * Needed for memory-mapped I/O devices mapped outside our normal DRAM * window (that is, all memory-mapped I/O devices). * * (C) Copyright 1995 1996 Linus Torvalds * CRIS-port by Axis Communications AB */ #include <linux/vmalloc.h> #include <asm/io.h> #include <asm/pgalloc.h> static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, unsigned long phys_addr, unsigned long flags) { unsigned long end; address &= ~PMD_MASK; end = address + size; if (end > PMD_SIZE) end = PMD_SIZE; if (address >= end) BUG(); do { if (!pte_none(*pte)) { printk("remap_area_pte: page already exists\n"); BUG(); } set_pte(pte, mk_pte_phys(phys_addr, __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | _PAGE_GLOBAL | _PAGE_KERNEL | flags))); address += PAGE_SIZE; phys_addr += PAGE_SIZE; pte++; } while (address && (address < end)); } static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size, unsigned long phys_addr, unsigned long flags) { unsigned long end; address &= ~PGDIR_MASK; end = address + size; if (end > PGDIR_SIZE) end = PGDIR_SIZE; phys_addr -= address; if (address >= end) BUG(); do { pte_t * pte = pte_alloc(&init_mm, pmd, address); if (!pte) return -ENOMEM; remap_area_pte(pte, address, end - address, address + phys_addr, flags); address = (address + PMD_SIZE) & PMD_MASK; pmd++; } while (address && (address < end)); return 0; } static int remap_area_pages(unsigned long address, unsigned long phys_addr, unsigned long size, unsigned long flags) { int error; pgd_t * dir; unsigned long end = address + size; phys_addr -= address; dir = pgd_offset(&init_mm, address); flush_cache_all(); if (address >= end) BUG(); spin_lock(&init_mm.page_table_lock); do { pmd_t *pmd; pmd = pmd_alloc(&init_mm, dir, address); error = -ENOMEM; if (!pmd) break; if (remap_area_pmd(pmd, address, end - address, phys_addr + address, flags)) break; error = 0; address = (address + PGDIR_SIZE) & PGDIR_MASK; dir++; } while (address && (address < end)); spin_unlock(&init_mm.page_table_lock); flush_tlb_all(); return error; } /* * Generic mapping function (not visible outside): */ /* * Remap an arbitrary physical address space into the kernel virtual * address space. Needed when the kernel wants to access high addresses * directly. * * NOTE! We need to allow non-page-aligned mappings too: we will obviously * have to convert them into an offset in a page-aligned mapping, but the * caller shouldn't need to know that small detail. */ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) { void * addr; struct vm_struct * area; unsigned long offset, last_addr; /* Don't allow wraparound or zero size */ last_addr = phys_addr + size - 1; if (!size || last_addr < phys_addr) return NULL; #if 0 /* TODO: Here we can put checks for driver-writer abuse... */ /* * Don't remap the low PCI/ISA area, it's always mapped.. */ if (phys_addr >= 0xA0000 && last_addr < 0x100000) return phys_to_virt(phys_addr); /* * Don't allow anybody to remap normal RAM that we're using.. */ if (phys_addr < virt_to_phys(high_memory)) { char *t_addr, *t_end; struct page *page; t_addr = __va(phys_addr); t_end = t_addr + (size - 1); for(page = virt_to_page(t_addr); page <= virt_to_page(t_end); page++) if(!PageReserved(page)) return NULL; } #endif /* * Mappings have to be page-aligned */ offset = phys_addr & ~PAGE_MASK; phys_addr &= PAGE_MASK; size = PAGE_ALIGN(last_addr) - phys_addr; /* * Ok, go for it.. */ area = get_vm_area(size, VM_IOREMAP); if (!area) return NULL; addr = area->addr; if (remap_area_pages(VMALLOC_VMADDR(addr), phys_addr, size, flags)) { vfree(addr); return NULL; } return (void *) (offset + (char *)addr); } void iounmap(void *addr) { if (addr > high_memory) return vfree((void *) (PAGE_MASK & (unsigned long) addr)); } Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/mm/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ Makefile 9 Apr 2002 17:03:16 -0000 1.2 @@ -8,6 +8,6 @@ # Note 2! The CFLAGS definition is now in the main makefile... O_TARGET := mm.o -obj-y := init.o fault.o tlb.o extable.o +obj-y := init.o fault.o tlb.o extable.o ioremap.o include $(TOPDIR)/Rules.make Index: extable.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/mm/extable.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- extable.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ extable.c 9 Apr 2002 17:03:16 -0000 1.2 @@ -1,13 +1,22 @@ /* * linux/arch/cris/mm/extable.c + * + * $Log$ + * Revision 1.2 2002/04/09 17:03:16 atp + * synch 2.4.15 commit 29 + * + * Revision 1.3 2001/09/27 13:52:40 bjornw + * Harmonize underscore-ness with other parts + * + * */ #include <linux/config.h> #include <linux/module.h> #include <asm/uaccess.h> -extern const struct exception_table_entry _start___ex_table[]; -extern const struct exception_table_entry _stop___ex_table[]; +extern const struct exception_table_entry __start___ex_table[]; +extern const struct exception_table_entry __stop___ex_table[]; static inline unsigned long search_one_table(const struct exception_table_entry *first, @@ -37,8 +46,7 @@ #ifndef CONFIG_MODULES /* There is only the kernel to search. */ - ret = search_one_table(_start___ex_table, _stop___ex_table-1, addr); - if (ret) return ret; + return search_one_table(__start___ex_table, __stop___ex_table-1, addr); #else /* The kernel is the last "module" -- no need to treat it special. */ struct module *mp; Index: fault.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/mm/fault.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fault.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ fault.c 9 Apr 2002 17:03:16 -0000 1.2 @@ -1,13 +1,48 @@ /* * linux/arch/cris/mm/fault.c * - * Copyright (C) 2000 Axis Communications AB + * Copyright (C) 2000, 2001 Axis Communications AB * * Authors: Bjorn Wesen * * $Log$ - * Revision 1.1.1.1 2001/02/25 23:15:23 kenn - * Import official 2.4.2 Linus tree + * Revision 1.2 2002/04/09 17:03:16 atp + * synch 2.4.15 commit 29 + * + * Revision 1.18 2001/07/18 22:14:32 bjornw + * Enable interrupts in the bulk of do_page_fault + * + * Revision 1.17 2001/07/18 13:07:23 bjornw + * * Detect non-existant PTE's in vmalloc pmd synchronization + * * Remove comment about fast-paths for VMALLOC_START etc, because all that + * was totally bogus anyway it turned out :) + * * Fix detection of vmalloc-area synchronization + * * Add some comments + * + * Revision 1.16 2001/06/13 00:06:08 bjornw + * current_pgd should be volatile + * + * Revision 1.15 2001/06/13 00:02:23 bjornw + * Use a separate variable to store the current pgd to avoid races in schedule + * + * Revision 1.14 2001/05/16 17:41:07 hp + * Last comment tweak further tweaked. + * + * Revision 1.13 2001/05/15 00:58:44 hp + * Expand a bit on the comment why we compare address >= TASK_SIZE rather + * than >= VMALLOC_START. + * + * Revision 1.12 2001/04/04 10:51:14 bjornw + * mmap_sem is grabbed for reading + * + * Revision 1.11 2001/03/23 07:36:07 starvik + * Corrected according to review remarks + * + * Revision 1.10 2001/03/21 16:10:11 bjornw + * CRIS_FRAME_FIXUP not needed anymore, use FRAME_NORMAL + * + * Revision 1.9 2001/03/05 13:22:20 bjornw + * Spell-fix and fix in vmalloc_fault handling * * Revision 1.8 2000/11/22 14:45:31 bjornw * * 2.4.0-test10 removed the set_pgdir instantaneous kernel global mapping @@ -50,7 +85,13 @@ /* debug of higher-level faults */ #define DPG(x) -/* fast TLB-fill fault handler */ +/* current active page directory */ + +volatile pgd_t *current_pgd; + +/* fast TLB-fill fault handler + * this is called from entry.S with interrupts disabled + */ void handle_mmu_bus_fault(struct pt_regs *regs) @@ -59,10 +100,9 @@ int index; int page_id; int miss, we, acc, inv; - struct mm_struct *mm = current->active_mm; pmd_t *pmd; pte_t pte; - int errcode = 0; + int errcode; unsigned long address; cause = *R_MMU_CAUSE; @@ -70,13 +110,27 @@ address = cause & PAGE_MASK; /* get faulting address */ - page_id = IO_EXTRACT(R_MMU_CAUSE, page_id, cause); + D(page_id = IO_EXTRACT(R_MMU_CAUSE, page_id, cause)); + D(acc = IO_EXTRACT(R_MMU_CAUSE, acc_excp, cause)); + D(inv = IO_EXTRACT(R_MMU_CAUSE, inv_excp, cause)); + D(index = IO_EXTRACT(R_TLB_SELECT, index, select)); miss = IO_EXTRACT(R_MMU_CAUSE, miss_excp, cause); we = IO_EXTRACT(R_MMU_CAUSE, we_excp, cause); - acc = IO_EXTRACT(R_MMU_CAUSE, acc_excp, cause); - inv = IO_EXTRACT(R_MMU_CAUSE, inv_excp, cause); - index = IO_EXTRACT(R_TLB_SELECT, index, select); + /* Note: the reason we don't set errcode's r/w flag here + * using the 'we' flag, is because the latter is only given + * if there is a write-protection exception, not given as a + * general r/w access mode flag. It is currently not possible + * to get this from the MMU (TODO: check if this is the case + * for LXv2). + * + * The page-fault code won't care, but there will be two page- + * faults instead of one for the case of a write to a non-tabled + * page (miss, then write-protection). + */ + + errcode = 0; + D(printk("bus_fault from IRP 0x%x: addr 0x%x, miss %d, inv %d, we %d, acc %d, " "idx %d pid %d\n", regs->irp, address, miss, inv, we, acc, index, page_id)); @@ -85,9 +139,11 @@ if(miss) { - /* see if the pte exists at all */ + /* see if the pte exists at all + * refer through current_pgd, dont use mm->pgd + */ - pmd = (pmd_t *)pgd_offset(mm, address); + pmd = (pmd_t *)(current_pgd + pgd_index(address)); if(pmd_none(*pmd)) goto dofault; if(pmd_bad(*pmd)) { @@ -129,14 +185,14 @@ * the write to R_TLB_LO also writes the vpn and page_id fields from * R_MMU_CAUSE, which we in this case obviously want to keep */ - + *R_TLB_LO = pte_val(pte); return; } - errcode = 0x01 | (we << 1); - + errcode = 1 | (we << 1); + dofault: /* leave it to the MM system fault handler below */ D(printk("do_page_fault %p errcode %d\n", address, errcode)); @@ -149,7 +205,7 @@ * routines. * * Notice that the address we're given is aligned to the page the fault - * occured in, since we only get the PFN in R_MMU_CAUSE not the complete + * occurred in, since we only get the PFN in R_MMU_CAUSE not the complete * address. * * error_code: @@ -186,23 +242,21 @@ * NOTE2: This is done so that, when updating the vmalloc * mappings we don't have to walk all processes pgdirs and * add the high mappings all at once. Instead we do it as they - * are used. + * are used. However vmalloc'ed page entries have the PAGE_GLOBAL + * bit set so sometimes the TLB can use a lingering entry. * - * TODO: On CRIS, we have a PTE Global bit which should be set in - * all the PTE's related to vmalloc in all processes - that means if - * we switch process and a vmalloc PTE is still in the TLB, it won't - * need to be reloaded. It's an optimization. - * - * Linux/CRIS's kernel is not page-mapped, so the comparision below - * should really be >= VMALLOC_START, however, kernel fixup errors - * will be handled more quickly by going through vmalloc_fault and then - * into bad_area_nosemaphore than falling through the find_vma user-mode - * tests. + * This verifies that the fault happens in kernel space + * and that the fault was not a protection error (error_code & 1). */ - if (address >= TASK_SIZE) + if (address >= VMALLOC_START && + !(error_code & 1) && + !user_mode(regs)) goto vmalloc_fault; + /* we can and should enable interrupts at this point */ + sti(); + mm = tsk->mm; writeaccess = error_code & 2; info.si_code = SEGV_MAPERR; @@ -215,7 +269,7 @@ if (in_interrupt() || !mm) goto no_context; - down(&mm->mmap_sem); + down_read(&mm->mmap_sem); vma = find_vma(mm, address); if (!vma) goto bad_area; @@ -273,7 +327,7 @@ goto out_of_memory; } - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); return; /* @@ -283,7 +337,7 @@ bad_area: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); bad_area_nosemaphore: DPG(show_registers(regs)); @@ -311,16 +365,25 @@ */ if ((fixup = search_exception_table(regs->irp)) != 0) { + /* Adjust the instruction pointer in the stackframe */ + regs->irp = fixup; - regs->frametype = CRIS_FRAME_FIXUP; + + /* We do not want to return by restoring the CPU-state + * anymore, so switch frame-types (see ptrace.h) + */ + + regs->frametype = CRIS_FRAME_NORMAL; + D(printk("doing fixup to 0x%x\n", fixup)); return; } -/* - * Oops. The kernel tried to access some bad page. We'll have to - * terminate things with extreme prejudice. - */ + /* + * Oops. The kernel tried to access some bad page. We'll have to + * terminate things with extreme prejudice. + */ + if ((unsigned long) (address) < PAGE_SIZE) printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); else @@ -337,14 +400,14 @@ */ out_of_memory: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); printk("VM: killing process %s\n", tsk->comm); if(user_mode(regs)) do_exit(SIGKILL); goto no_context; do_sigbus: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); /* * Send a sigbus, regardless of whether we were in kernel @@ -366,28 +429,52 @@ /* * Synchronize this task's top level page-table * with the 'reference' page table. + * + * Use current_pgd instead of tsk->active_mm->pgd + * since the latter might be unavailable if this + * code is executed in a misfortunately run irq + * (like inside schedule() between switch_mm and + * switch_to...). */ + int offset = pgd_index(address); pgd_t *pgd, *pgd_k; pmd_t *pmd, *pmd_k; + pte_t *pte_k; - pgd = tsk->active_mm->pgd + offset; + pgd = current_pgd + offset; pgd_k = init_mm.pgd + offset; - if (!pgd_present(*pgd)) { - if (!pgd_present(*pgd_k)) - goto bad_area_nosemaphore; - set_pgd(pgd, *pgd_k); - return; - } + /* Since we're two-level, we don't need to do both + * set_pgd and set_pmd (they do the same thing). If + * we go three-level at some point, do the right thing + * with pgd_present and set_pgd here. + * + * Also, since the vmalloc area is global, we don't + * need to copy individual PTE's, it is enough to + * copy the pgd pointer into the pte page of the + * root task. If that is there, we'll find our pte if + * it exists. + */ pmd = pmd_offset(pgd, address); pmd_k = pmd_offset(pgd_k, address); - if (pmd_present(*pmd) || !pmd_present(*pmd_k)) + if (!pmd_present(*pmd_k)) goto bad_area_nosemaphore; + set_pmd(pmd, *pmd_k); + + /* Make sure the actual PTE exists as well to + * catch kernel vmalloc-area accesses to non-mapped + * addresses. If we don't do this, this will just + * silently loop forever. + */ + + pte_k = pte_offset(pmd_k, address); + if (!pte_present(*pte_k)) + goto no_context; + return; } - } Index: init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/mm/init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- init.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ init.c 9 Apr 2002 17:03:16 -0000 1.2 @@ -2,13 +2,58 @@ * linux/arch/cris/mm/init.c * * Copyright (C) 1995 Linus Torvalds - * Copyright (C) 2000 Axis Communications AB + * Copyright (C) 2000,2001 Axis Communications AB * * Authors: Bjorn Wesen (bj...@ax...) * * $Log$ - * Revision 1.1.1.1 2001/02/25 23:15:23 kenn - * Import official 2.4.2 Linus tree + * Revision 1.2 2002/04/09 17:03:16 atp + * synch 2.4.15 commit 29 + * + * Revision 1.29 2001/07/25 16:09:50 bjornw + * val->sharedram will stay 0 + * + * Revision 1.28 2001/06/28 16:30:17 bjornw + * Oops. This needs to wait until 2.4.6 is merged + * + * Revision 1.27 2001/06/28 14:04:07 bjornw + * Fill in sharedram + * + * Revision 1.26 2001/06/18 06:36:02 hp + * Enable free_initmem of __init-type pages + * + * Revision 1.25 2001/06/13 00:02:23 bjornw + * Use a separate variable to store the current pgd to avoid races in schedule + * + * Revision 1.24 2001/05/15 00:52:20 hp + * Only map segment 0xa as seg if CONFIG_JULIETTE + * + * Revision 1.23 2001/04/04 14:35:40 bjornw + * * Removed get_pte_slow and friends (2.4.3 change) + * * Removed bad_pmd handling (2.4.3 change) + * + * Revision 1.22 2001/04/04 13:38:04 matsfg + * Moved ioremap to a separate function instead + * + * Revision 1.21 2001/03/27 09:28:33 bjornw + * ioremap used too early - lets try it in mem_init instead + * + * Revision 1.20 2001/03/23 07:39:21 starvik + * Corrected according to review remarks + * + * Revision 1.19 2001/03/15 14:25:17 bjornw + * More general shadow registers and ioremaped addresses for external I/O + * + * Revision 1.18 2001/02/23 12:46:44 bjornw + * * 0xc was not CSE1; 0x8 is, same as uncached flash, so we move the uncached + * flash during CRIS_LOW_MAP from 0xe to 0x8 so both the flash and the I/O + * is mapped straight over (for !CRIS_LOW_MAP the uncached flash is still 0xe) + * + * Revision 1.17 2001/02/22 15:05:21 bjornw + * Map 0x9 straight over during LOW_MAP to allow for memory mapped LEDs + * + * Revision 1.16 2001/02/22 15:02:35 bjornw + * Map 0xc straight over during LOW_MAP to allow for memory mapped I/O * * Revision 1.15 2001/01/10 21:12:10 bjornw * loops_per_sec -> loops_per_jiffy @@ -60,6 +105,8 @@ #include <asm/pgtable.h> #include <asm/dma.h> #include <asm/svinto.h> +#include <asm/io.h> +#include <asm/mmu_context.h> static unsigned long totalram_pages; @@ -71,128 +118,13 @@ extern void show_net_buffers(void); extern void tlb_init(void); -/* - * empty_bad_page is the page that is used for page faults when linux - * is out-of-memory. Older versions of linux just did a - * do_exit(), but using this instead means there is less risk - * for a process dying in kernel mode, possibly leaving a inode - * unused etc.. - * - * the main point is that when a page table error occurs, we want to get - * out of the kernel safely before killing the process, so we need something - * to feed the MMU with when the fault occurs even if we don't have any - * real PTE's or page tables. - * - * empty_bad_page_table is the accompanying page-table: it is initialized - * to point to empty_bad_page writable-shared entries. - * - * empty_zero_page is a special page that is used for zero-initialized - * data and COW. - */ -unsigned long empty_bad_page_table; -unsigned long empty_bad_page; unsigned long empty_zero_page; -pte_t * __bad_pagetable(void) -{ - /* somehow it is enough to just clear it and not fill it with - * bad page PTE's... - */ - memset((void *)empty_bad_page_table, 0, PAGE_SIZE); - - return (pte_t *) empty_bad_page_table; -} - -pte_t __bad_page(void) -{ - - /* clear the empty_bad_page page. this should perhaps be - * a more simple inlined loop like it is on the other - * architectures. - */ - - memset((void *)empty_bad_page, 0, PAGE_SIZE); - - return pte_mkdirty(__mk_pte((void *)empty_bad_page, PAGE_SHARED)); -} - -static pte_t * get_bad_pte_table(void) -{ - pte_t *empty_bad_pte_table = (pte_t *)empty_bad_page_table; - pte_t v; - int i; - - v = __bad_page(); - - for (i = 0; i < PAGE_SIZE/sizeof(pte_t); i++) - empty_bad_pte_table[i] = v; - - return empty_bad_pte_table; -} - -void __handle_bad_pmd(pmd_t *pmd) -{ - pmd_ERROR(*pmd); - pmd_set(pmd, get_bad_pte_table()); -} - -void __handle_bad_pmd_kernel(pmd_t *pmd) -{ - pmd_ERROR(*pmd); - pmd_set_kernel(pmd, get_bad_pte_table()); -} - -pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long offset) -{ - pte_t *pte; - - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pmd_none(*pmd)) { - if (pte) { - clear_page(pte); - pmd_set_kernel(pmd, pte); - return pte + offset; - } - pmd_set_kernel(pmd, get_bad_pte_table()); - return NULL; - } - free_page((unsigned long)pte); - if (pmd_bad(*pmd)) { - __handle_bad_pmd_kernel(pmd); - return NULL; - } - return (pte_t *) pmd_page(*pmd) + offset; -} - -pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset) -{ - pte_t *pte; - - pte = (pte_t *) __get_free_page(GFP_KERNEL); - if (pmd_none(*pmd)) { - if (pte) { - clear_page(pte); - pmd_set(pmd, pte); - return pte + offset; - } - pmd_set(pmd, get_bad_pte_table()); - return NULL; - } - free_page((unsigned long)pte); - if (pmd_bad(*pmd)) { - __handle_bad_pmd(pmd); - return NULL; - } - return (pte_t *) pmd_page(*pmd) + offset; -} - -#ifndef CONFIG_NO_PGT_CACHE -struct pgtable_cache_struct quicklists; - /* trim the page-table cache if necessary */ -int do_check_pgt_cache(int low, int high) +int +do_check_pgt_cache(int low, int high) { int freed = 0; @@ -203,25 +135,20 @@ freed++; } if(pmd_quicklist) { - free_pmd_slow(get_pmd_fast()); + pmd_free_slow(pmd_alloc_one_fast(NULL, 0)); freed++; } if(pte_quicklist) { - free_pte_slow(get_pte_fast()); - freed++; + pte_free_slow(pte_alloc_one_fast(NULL, 0)); + freed++; } } while(pgtable_cache_size > low); } return freed; } -#else -int do_check_pgt_cache(int low, int high) -{ - return 0; -} -#endif -void show_mem(void) +void +show_mem(void) { int i,free = 0,total = 0,cached = 0, reserved = 0, nonshared = 0; int shared = 0; @@ -272,6 +199,13 @@ for(i = 0; i < PTRS_PER_PGD; i++) swapper_pg_dir[i] = __pgd(0); + + /* make sure the current pgd table points to something sane + * (even if it is most probably not used until the next + * switch_mm) + */ + + current_pgd = init_mm.pgd; /* initialise the TLB (tlb.c) */ @@ -279,27 +213,70 @@ /* see README.mm for details on the KSEG setup */ -#ifdef CONFIG_CRIS_LOW_MAP +#ifndef CONFIG_CRIS_LOW_MAP + /* This code is for the corrected Etrax-100 LX version 2... */ + + *R_MMU_KSEG = ( IO_STATE(R_MMU_KSEG, seg_f, seg ) | /* cached flash */ + IO_STATE(R_MMU_KSEG, seg_e, seg ) | /* uncached flash */ + IO_STATE(R_MMU_KSEG, seg_d, page ) | /* vmalloc area */ + IO_STATE(R_MMU_KSEG, seg_c, seg ) | /* kernel area */ + IO_STATE(R_MMU_KSEG, seg_b, seg ) | /* kernel reg area */ + IO_STATE(R_MMU_KSEG, seg_a, page ) | /* user area */ + IO_STATE(R_MMU_KSEG, seg_9, page ) | + IO_STATE(R_MMU_KSEG, seg_8, page ) | + IO_STATE(R_MMU_KSEG, seg_7, page ) | + IO_STATE(R_MMU_KSEG, seg_6, page ) | + IO_STATE(R_MMU_KSEG, seg_5, page ) | + IO_STATE(R_MMU_KSEG, seg_4, page ) | + IO_STATE(R_MMU_KSEG, seg_3, page ) | + IO_STATE(R_MMU_KSEG, seg_2, page ) | + IO_STATE(R_MMU_KSEG, seg_1, page ) | + IO_STATE(R_MMU_KSEG, seg_0, page ) ); + *R_MMU_KBASE_HI = ( IO_FIELD(R_MMU_KBASE_HI, base_f, 0x0 ) | + IO_FIELD(R_MMU_KBASE_HI, base_e, 0x8 ) | + IO_FIELD(R_MMU_KBASE_HI, base_d, 0x0 ) | + IO_FIELD(R_MMU_KBASE_HI, base_c, 0x4 ) | + IO_FIELD(R_MMU_KBASE_HI, base_b, 0xb ) | + IO_FIELD(R_MMU_KBASE_HI, base_a, 0x0 ) | + IO_FIELD(R_MMU_KBASE_HI, base_9, 0x0 ) | + IO_FIELD(R_MMU_KBASE_HI, base_8, 0x0 ) ); + + *R_MMU_KBASE_LO = ( IO_FIELD(R_MMU_KBASE_LO, base_7, 0x0 ) | + IO_FIELD(R_MMU_KBASE_LO, base_6, 0x0 ) | + IO_FIELD(R_MMU_KBASE_LO, base_5, 0x0 ) | + IO_FIELD(R_MMU_KBASE_LO, base_4, 0x0 ) | + IO_FIELD(R_MMU_KBASE_LO, base_3, 0x0 ) | + IO_FIELD(R_MMU_KBASE_LO, base_2, 0x0 ) | + IO_FIELD(R_MMU_KBASE_LO, base_1, 0x0 ) | + IO_FIELD(R_MMU_KBASE_LO, base_0, 0x0 ) ); +#else /* Etrax-100 LX version 1 has a bug so that we cannot map anything * across the 0x80000000 boundary, so we need to shrink the user-virtual * area to 0x50000000 instead of 0xb0000000 and map things slightly * different. The unused areas are marked as paged so that we can catch * freak kernel accesses there. * - * The Juliette chip is mapped at 0xa so we pass that segment straight + * The ARTPEC chip is mapped at 0xa so we pass that segment straight * through. We cannot vremap it because the vmalloc area is below 0x8 * and Juliette needs an uncached area above 0x8. + * + * Same thing with 0xc and 0x9, which is memory-mapped I/O on some boards. + * We map them straight over in LOW_MAP, but use vremap in LX version 2. */ *R_MMU_KSEG = ( IO_STATE(R_MMU_KSEG, seg_f, page ) | - IO_STATE(R_MMU_KSEG, seg_e, seg ) | /* uncached flash */ + IO_STATE(R_MMU_KSEG, seg_e, page ) | IO_STATE(R_MMU_KSEG, seg_d, page ) | - IO_STATE(R_MMU_KSEG, seg_c, page ) | + IO_STATE(R_MMU_KSEG, seg_c, page ) | IO_STATE(R_MMU_KSEG, seg_b, seg ) | /* kernel reg area */ - IO_STATE(R_MMU_KSEG, seg_a, seg ) | /* Juliette etc. */ - IO_STATE(R_MMU_KSEG, seg_9, page ) | - IO_STATE(R_MMU_KSEG, seg_8, page ) | +#ifdef CONFIG_JULIETTE + IO_STATE(R_MMU_KSEG, seg_a, seg ) | /* ARTPEC etc. */ +#else + IO_STATE(R_MMU_KSEG, seg_a, page ) | +#endif + IO_STATE(R_MMU_KSEG, seg_9, seg ) | /* LED's on some boards */ + IO_STATE(R_MMU_KSEG, seg_8, seg ) | /* CSE0/1, flash and I/O */ IO_STATE(R_MMU_KSEG, seg_7, page ) | /* kernel vmalloc area */ IO_STATE(R_MMU_KSEG, seg_6, seg ) | /* kernel DRAM area */ IO_STATE(R_MMU_KSEG, seg_5, seg ) | /* cached flash */ @@ -310,60 +287,27 @@ IO_STATE(R_MMU_KSEG, seg_0, page ) ); /* user area */ *R_MMU_KBASE_HI = ( IO_FIELD(R_MMU_KBASE_HI, base_f, 0x0 ) | - IO_FIELD(R_MMU_KBASE_HI, base_e, 0x8 ) | + IO_FIELD(R_MMU_KBASE_HI, base_e, 0x0 ) | IO_FIELD(R_MMU_KBASE_HI, base_d, 0x0 ) | IO_FIELD(R_MMU_KBASE_HI, base_c, 0x0 ) | IO_FIELD(R_MMU_KBASE_HI, base_b, 0xb ) | +#ifdef CONFIG_JULIETTE IO_FIELD(R_MMU_KBASE_HI, base_a, 0xa ) | - IO_FIELD(R_MMU_KBASE_HI, base_9, 0x0 ) | - IO_FIELD(R_MMU_KBASE_HI, base_8, 0x0 ) ); - - *R_MMU_KBASE_LO = ( IO_FIELD(R_MMU_KBASE_LO, base_7, 0x0 ) | - IO_FIELD(R_MMU_KBASE_LO, base_6, 0x4 ) | - IO_FIELD(R_MMU_KBASE_LO, base_5, 0x0 ) | - IO_FIELD(R_MMU_KBASE_LO, base_4, 0x0 ) | - IO_FIELD(R_MMU_KBASE_LO, base_3, 0x0 ) | - IO_FIELD(R_MMU_KBASE_LO, base_2, 0x0 ) | - IO_FIELD(R_MMU_KBASE_LO, base_1, 0x0 ) | - IO_FIELD(R_MMU_KBASE_LO, base_0, 0x0 ) ); #else - /* This code is for the hopefully corrected Etrax-100 LX version 2... */ - - *R_MMU_KSEG = ( IO_STATE(R_MMU_KSEG, seg_f, seg ) | /* cached flash */ - IO_STATE(R_MMU_KSEG, seg_e, seg ) | /* uncached flash */ - IO_STATE(R_MMU_KSEG, seg_d, page ) | /* vmalloc area */ - IO_STATE(R_MMU_KSEG, seg_c, seg ) | /* kernel area */ - IO_STATE(R_MMU_KSEG, seg_b, seg ) | /* kernel reg area */ - IO_STATE(R_MMU_KSEG, seg_a, page ) | /* user area */ - IO_STATE(R_MMU_KSEG, seg_9, page ) | - IO_STATE(R_MMU_KSEG, seg_8, page ) | - IO_STATE(R_MMU_KSEG, seg_7, page ) | - IO_STATE(R_MMU_KSEG, seg_6, page ) | - IO_STATE(R_MMU_KSEG, seg_5, page ) | - IO_STATE(R_MMU_KSEG, seg_4, page ) | - IO_STATE(R_MMU_KSEG, seg_3, page ) | - IO_STATE(R_MMU_KSEG, seg_2, page ) | - IO_STATE(R_MMU_KSEG, seg_1, page ) | - IO_STATE(R_MMU_KSEG, seg_0, page ) ); - - *R_MMU_KBASE_HI = ( IO_FIELD(R_MMU_KBASE_HI, base_f, 0x0 ) | - IO_FIELD(R_MMU_KBASE_HI, base_e, 0x8 ) | - IO_FIELD(R_MMU_KBASE_HI, base_d, 0x0 ) | - IO_FIELD(R_MMU_KBASE_HI, base_c, 0x4 ) | - IO_FIELD(R_MMU_KBASE_HI, base_b, 0xb ) | IO_FIELD(R_MMU_KBASE_HI, base_a, 0x0 ) | - IO_FIELD(R_MMU_KBASE_HI, base_9, 0x0 ) | - IO_FIELD(R_MMU_KBASE_HI, base_8, 0x0 ) ); +#endif + IO_FIELD(R_MMU_KBASE_HI, base_9, 0x9 ) | + IO_FIELD(R_MMU_KBASE_HI, base_8, 0x8 ) ); *R_MMU_KBASE_LO = ( IO_FIELD(R_MMU_KBASE_LO, base_7, 0x0 ) | - IO_FIELD(R_MMU_KBASE_LO, base_6, 0x0 ) | + IO_FIELD(R_MMU_KBASE_LO, base_6, 0x4 ) | IO_FIELD(R_MMU_KBASE_LO, base_5, 0x0 ) | IO_FIELD(R_MMU_KBASE_LO, base_4, 0x0 ) | IO_FIELD(R_MMU_KBASE_LO, base_3, 0x0 ) | IO_FIELD(R_MMU_KBASE_LO, base_2, 0x0 ) | IO_FIELD(R_MMU_KBASE_LO, base_1, 0x0 ) | IO_FIELD(R_MMU_KBASE_LO, base_0, 0x0 ) ); -#endif +#endif *R_MMU_CONTEXT = ( IO_FIELD(R_MMU_CONTEXT, page_id, 0 ) ); @@ -382,8 +326,6 @@ * to a couple of allocated pages */ - empty_bad_page_table = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); - empty_bad_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); memset((void *)empty_zero_page, 0, PAGE_SIZE); @@ -401,6 +343,7 @@ */ free_area_init_node(0, 0, 0, zones_size, PAGE_OFFSET, 0); + } extern unsigned long loops_per_jiffy; /* init/main.c */ @@ -451,7 +394,7 @@ datasize >> 10, initsize >> 10 ); - + /* HACK alert - calculate a loops_per_usec for asm/delay.h here * since this is called just after calibrate_delay in init/main.c * but before places which use udelay. cannot be in time.c since @@ -463,15 +406,53 @@ return; } +/* Initialize remaps of some I/O-ports. This is designed to be callable + * multiple times from the drivers init-sections, because we don't know + * beforehand which driver will get initialized first. + */ + +void +init_ioremap(void) +{ + + /* Give the external I/O-port addresses their values */ + + static int initialized = 0; + + if( !initialized ) { + initialized++; + +#ifdef CONFIG_CRIS_LOW_MAP + /* Simply a linear map (see the KSEG map above in paging_init) */ + port_cse1_addr = (volatile unsigned long *)(MEM_CSE1_START | + MEM_NON_CACHEABLE); + port_csp0_addr = (volatile unsigned long *)(MEM_CSP0_START | + MEM_NON_CACHEABLE); + port_csp4_addr = (volatile unsigned long *)(MEM_CSP4_START | + MEM_NON_CACHEABLE); +#else + /* Note that nothing blows up just because we do this remapping + * it's ok even if the ports are not used or connected + * to anything (or connected to a non-I/O thing) */ + port_cse1_addr = (volatile unsigned long *) + ioremap((unsigned long)(MEM_CSE1_START | + MEM_NON_CACHEABLE), 16); + port_csp0_addr = (volatile unsigned long *) + ioremap((unsigned long)(MEM_CSP0_START | + MEM_NON_CACHEABLE), 16); + port_csp4_addr = (volatile unsigned long *) + ioremap((unsigned long)(MEM_CSP4_START | + MEM_NON_CACHEABLE), 16); +#endif + } +} + + /* free the pages occupied by initialization code */ -void free_initmem(void) +void +free_initmem(void) { -#if 0 - /* currently this is a bad idea since the cramfs image is catted onto - * the vmlinux image, and the end of that image is not page-padded so - * part of the cramfs image will be freed here - */ unsigned long addr; addr = (unsigned long)(&__init_begin); @@ -483,10 +464,10 @@ } printk ("Freeing unused kernel memory: %dk freed\n", (&__init_end - &__init_begin) >> 10); -#endif } -void si_meminfo(struct sysinfo *val) +void +si_meminfo(struct sysinfo *val) { int i; Index: tlb.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/mm/tlb.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- tlb.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ tlb.c 9 Apr 2002 17:03:16 -0000 1.2 @@ -1,7 +1,7 @@ /* * linux/arch/cris/mm/tlb.c * - * Copyright (C) 2000 Axis Communications AB + * Copyright (C) 2000, 2001 Axis Communications AB * * Authors: Bjorn Wesen (bj...@ax...) * @@ -21,6 +21,7 @@ #include <asm/segment.h> #include <asm/pgtable.h> #include <asm/svinto.h> +#include <asm/mmu_context.h> #define D(x) @@ -39,6 +40,10 @@ * * The last page_id is never running - it is used as an invalid page_id * so we can make TLB entries that will never match. + * + * Notice that we need to make the flushes atomic, otherwise an interrupt + * handler that uses vmalloced memory might cause a TLB load in the middle + * of a flush causing. */ struct mm_struct *page_id_map[NUM_PAGEID]; @@ -48,17 +53,18 @@ /* invalidate all TLB entries */ void -flush_tlb_all() +flush_tlb_all(void) { int i; + unsigned long flags; /* the vpn of i & 0xf is so we dont write similar TLB entries * in the same 4-way entry group. details.. */ + save_and_cli(flags); /* flush needs to be atomic */ for(i = 0; i < NUM_TLB_ENTRIES; i++) { *R_TLB_SELECT = ( IO_FIELD(R_TLB_SELECT, index, i) ); - *R_TLB_HI = ( IO_FIELD(R_TLB_HI, page_id, INVALID_PAGEID ) | IO_FIELD(R_TLB_HI, vpn, i & 0xf ) ); @@ -68,6 +74,7 @@ IO_STATE(R_TLB_LO, we, no ) | IO_FIELD(R_TLB_LO, pfn, 0 ) ); } + restore_flags(flags); D(printk("tlb: flushed all\n")); } @@ -78,6 +85,7 @@ { int i; int page_id = mm->context; + unsigned long flags; D(printk("tlb: flush mm context %d (%p)\n", page_id, mm)); @@ -89,6 +97,7 @@ * global pages. is it worth the extra I/O ? */ + save_and_cli(flags); /* flush needs to be atomic */ for(i = 0; i < NUM_TLB_ENTRIES; i++) { *R_TLB_SELECT = IO_FIELD(R_TLB_SELECT, index, i); if (IO_EXTRACT(R_TLB_HI, page_id, *R_TLB_HI) == page_id) { @@ -102,6 +111,7 @@ IO_FIELD(R_TLB_LO, pfn, 0 ) ); } } + restore_flags(flags); } /* invalidate a single page */ @@ -113,6 +123,7 @@ struct mm_struct *mm = vma->vm_mm; int page_id = mm->context; int i; + unsigned long flags; D(printk("tlb: flush page %p in context %d (%p)\n", addr, page_id, mm)); @@ -125,6 +136,7 @@ * and the virtual address requested */ + save_and_cli(flags); /* flush needs to be atomic */ for(i = 0; i < NUM_TLB_ENTRIES; i++) { unsigned long tlb_hi; *R_TLB_SELECT = IO_FIELD(R_TLB_SELECT, index, i); @@ -141,6 +153,7 @@ IO_FIELD(R_TLB_LO, pfn, 0 ) ); } } + restore_flags(flags); } /* invalidate a page range */ @@ -152,6 +165,7 @@ { int page_id = mm->context; int i; + unsigned long flags; D(printk("tlb: flush range %p<->%p in context %d (%p)\n", start, end, page_id, mm)); @@ -166,6 +180,7 @@ * and the virtual address range */ + save_and_cli(flags); /* flush needs to be atomic */ for(i = 0; i < NUM_TLB_ENTRIES; i++) { unsigned long tlb_hi, vpn; *R_TLB_SELECT = IO_FIELD(R_TLB_SELECT, index, i); @@ -183,8 +198,30 @@ IO_FIELD(R_TLB_LO, pfn, 0 ) ); } } + restore_flags(flags); } +/* dump the entire TLB for debug purposes */ + +#if 0 +void +dump_tlb_all(void) +{ + int i; + unsigned long flags; + + printk("TLB dump. LO is: pfn | reserved | global | valid | kernel | we |\n"); + + save_and_cli(flags); + for(i = 0; i < NUM_TLB_ENTRIES; i++) { + *R_TLB_SELECT = ( IO_FIELD(R_TLB_SELECT, index, i) ); + printk("Entry %d: HI 0x%08lx, LO 0x%08lx\n", + i, *R_TLB_HI, *R_TLB_LO); + } + restore_flags(flags); +} +#endif + /* * Initialize the context related info for a new mm_struct * instance. @@ -227,8 +264,7 @@ map_replace_ptr++; if(map_replace_ptr == INVALID_PAGEID) - map_replace_ptr = 0; /* wrap around */ - + map_replace_ptr = 0; /* wrap around */ } /* @@ -252,6 +288,15 @@ get_mmu_context(next); + /* remember the pgd for the fault handlers + * this is similar to the pgd register in some other CPU's. + * we need our own copy of it because current and active_mm + * might be invalid at points where we still need to derefer + * the pgd. + */ + + current_pgd = next->pgd; + /* switch context in the MMU */ D(printk("switching mmu_context to %d (%p)\n", next->context, next)); @@ -288,7 +333,7 @@ /* clear the page_id map */ - for(i = 0; i < 64; i++) + for (i = 1; i < sizeof (page_id_map) / sizeof (page_id_map[0]); i++) page_id_map[i] = NULL; /* invalidate the entire TLB */ |
From: Andy P. <at...@us...> - 2002-04-09 17:08:25
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/s390/boot In directory usw-pr-cvs1:/tmp/cvs-serv13825/s390/boot Modified Files: Makefile Log Message: synch 2.4.15 commit 29 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390/boot/Makefile,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- Makefile 25 Feb 2001 23:15:22 -0000 1.1.1.2 +++ Makefile 9 Apr 2002 17:03:16 -0000 1.2 @@ -1,5 +1,5 @@ # -# Makefile for the linux s390-specific parts of the memory manager. +# arch/s390/boot/Makefile # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here @@ -25,7 +25,7 @@ image: $(CONFIGURE) $(TOPDIR)/vmlinux \ iplfba.boot ipleckd.boot ipldump.boot $(OBJCOPY) -O binary $(TOPDIR)/vmlinux image - $(NM) $(TOPDIR)/vmlinux | grep -v '\(compiled\)\|\( [aU] \)\|\(\.\)\|\(LASH[RL]DI\)' | sort > $(TOPDIR)/System.map + $(NM) $(TOPDIR)/vmlinux | grep -v '\(compiled\)\|\( [aUw] \)\|\(\.\)\|\(LASH[RL]DI\)' | sort > $(TOPDIR)/System.map listing: ../../../vmlinux $(OBJDUMP) --disassemble --disassemble-all --disassemble-zeroes --reloc $(TOPDIR)/vmlinux > listing |
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/fb In directory usw-pr-cvs1:/tmp/cvs-serv7449/fb Modified Files: 00-INDEX clgenfb.txt framebuffer.txt matroxfb.txt tgafb.txt Added Files: README-sstfb.txt pvr2fb.txt Log Message: synch 2.4.15 commit 28 --- NEW FILE --- Introduction This is a frame buffer device driver for 3dfx' Voodoo Graphics (aka voodoo 1, aka sst1) and Voodoo² (aka Voodoo 2, aka CVG) based video boards. It's highly experimental code, but is guaranteed to work on my computer, with my "Maxi Gamer 3D" and "Maxi Gamer 3d²" boards, and with me "between chair and keyboard". Some people tested other combinations and it seems that it works. The main page is located at <http://sstfb.sourceforge.net>, and if you want the latest version, check out the CVS, as the driver is a work in progress, i feel incomfortable with releasing tarballs of something not completely working...Don't worry, it's still more than useable (I eat my own dog food) Please read the Bug section, and report any success or failure to me (Ghozlane Toumi <gt...@me...>). BTW, If you have only one monitor , and you don't feel like playing with the vga passthrou cable, I can only suggest borrowing a screen somewhere... Installation This driver (should) work on ix86, with any 2.2.x kernel (tested with x = 19) and "recent" 2.4.x kernel, as a module or compiled in. You can apply the patches found in sstfb/kernel/*-2.{2|4}.x.patch, and copy sstfb.c to linux/drivers/video/, or apply a single patch, sstfb/patch-2.{2|4}.x-sstfb-yymmdd to your linux source tree. Then configure your kernel as usual: choose "m" or "y" to 3Dfx Voodoo Graphics in section "console". Compile, install, have fun... and please drop me a report :) Module Usage Warnings. # You should read completely this section before issuing any command. # If you have only one monitor to play with, once you insmod the module, the 3dfx takes control of the output, so you'll have to plug the monitor to the "normal" video board in order to issue the commands, or you can blindly use sst_dbg_vgapass in the tools directory (See Tools). The latest option is pass the parameter vgapass=1 when insmodding the driver. (See Kernel/Modules Options) Module insertion: # insmod sstfb.o you should see some strange output frome the board: a big blue square, a green and a red small squares and a vertical white rectangle. why ? the function's name is self explanatory : "sstfb_test()"... (if you don't have a second monitor, you'll have to plug your monitor directely to the 2D videocard to see what you're typing) # con2fb /dev/fbx /dev/ttyx bind a tty to the new frame buffer. if you already have a frame buffer driver, the voodoo fb will likely be /dev/fb1. if not, the device will be /dev/fb0. You can check this by doing a cat /proc/fb. You can find a copy of con2fb in tools/ directory. if you don't have another fb device, this step is superfluous, as the console subsystem automagicaly binds ttys to the fb. # switch to the virtual console you just mapped. "tadaaa" ... Module removal: # con2fb /dev/fbx /dev/ttyx bind the tty to the old frame buffer so the module can be removed. (how does it work with vgacon ? short answer : it doesn't work) # rmmod sstfb Kernel/Modules Options You can pass some otions to sstfb module, and via the kernel command line when the driver is compiled in : for module : insmod sstfb.o option1=value1 option2=value2 ... in kernel : video=sstfb:option1,option2:value2,option3 ... sstfb supports the folowing options : module kernel description vgapass=1 vgapass enable or disable VGA passthrou cable vgapass=0 vganopass when enabled, the monitor will get the signal from the VGA board and not from the voodoo. default nopass mem=x mem:x force frame buffer memory in MiB allowed values: 1, 2, 4. default detect inverse=1 inverse suposed to enable inverse console. doesn't work ... clipping=1 clipping enable or disable clipping . with clipping=0 noclipping clipping enabled, all offscreen reads and writes are disgarded. default: enable clipping. gfxclk=x gfxclk:x force graphic clock frequency (in MHz) becarefull with this option . default is 50Mhz for voodoo1, 75MHz for voodoo2. Be carefull, this one is dangerous. default=auto slowpci=0 slowpci enable or disable fast PCI read/writes slowpci=1 fastpci default : fastpci dev=x dev:x attach the driver to device number x 0 is the first compatible board (in lspci order) Tools These tools are mostly for debugging purposes, but you can find some of these interesting : - con2fb , maps a tty to a fbramebuffer . con2fb /dev/fb1 /dev/tty5 - sst_dbg_vgapass , changes vga passthrou. You have to recompile the driver with SST_DEBUG and SST_DEBUG_IOCTL set to 1 sst_dbg_vgapass /dev/fb1 1 (enables vga cable) sst_dbg_vgapass /dev/fb1 0 (disables vga cable) - glide_reset , resets the voodoo using glide use this after rmmoding sstfb, if the module refuses to reinsert . Bugs - DO NOT use glide while the sstfb module is in, you'll most likely hang your computer. - if you see some artefacts (pixels not cleaning and stuff like that), try turning off clipping (clipping=0) - the driver don't detect the 4Mb frame buffer voodoos, it seems that the 2 last Mbs wrap around. looking into that . - The driver is 16 bpp only, 24/32 won't work. - The driver is not your_favorite_toy-safe. this includes SMP... [Actually from inspection it seems to be safe - Alan] - when using XFree86 FBdev (X over fbdev) you may see strange color patterns at the border of your windows (the pixels loose the lowest byte -> basicaly the blue component nd some of the green) . I'm unable to reproduce this with XFree86-3.3, but one of the testers has this problem with XFree86-4. I don't know yet if this is the drivers fault or X's (most likely the driver, of course). - I didn't really test changing the palette, so you may find some weird things when playing with that. - Sometimes the driver will not recognise the DAC , and the initialisation will fail. this is specificaly true for voodoo 2 boards , but it should be solved in recent versions. please contact me . - the 24/32 is not likely to work anytime soon , knowing that the hardware does ... unusual thigs in 24/32 bpp Todo - Get rid of the previous paragraph. - Buy more coffee. - test/port to other arch. - try to add panning using tweeks with front and back buffer . - try to implement accel en voodoo2 , this board can actualy do a lot in 2D even if it was sold as a 3D only board ... ghoz. -- Ghozlane Toumi <gt...@me...> $Date: 2002/04/09 16:55:41 $ http://sstfb.sourceforge.net/README --- NEW FILE --- $Id: pvr2fb.txt,v 1.1 2002/04/09 16:55:41 atp Exp $ What is pvr2fb? =============== This is a driver for PowerVR 2 based graphics frame buffers, such as the one found in the Dreamcast. Advantages: * It provides a nice large console (128 cols + 48 lines with 1024x768) without using tiny, unreadable fonts. * You can run XF86_FBDev on top of /dev/fb0 * Most important: boot logo :-) Disadvantages: * Driver is currently limited to the Dreamcast PowerVR 2 implementation at the time of this writing. Configuration ============= You can pass kernel command line options to pvr2fb with `video=pvr2:option1,option2:value2,option3' (multiple options should be separated by comma, values are separated from options by `:'). Accepted options: font:X - default font to use. All fonts are supported, including the SUN12x22 font which is very nice at high resolutions. mode:X - default video mode. The following video modes are supported: 640x240-60, 640x480-60. Note: the 640x240 mode is currently broken, and should not be used for any reason. It is only mentioned as a reference. inverse - invert colors on screen (for LCD displays) nomtrr - disables write combining on frame buffer. This slows down driver but there is reported minor incompatibility between GUS DMA and XFree under high loads if write combining is enabled (sound dropouts). MTRR is enabled by default on systems that have it configured and that support it. cable:X - cable type. This can be any of the following: vga, rgb, and composite. If none is specified, we guess. output:X - output type. This can be any of the following: pal, ntsc, and vga. If none is specified, we guess. X11 === XF86_FBDev should work, in theory. At the time of this writing it is totally untested and may or may not even portray the beginnings of working. If you end up testing this, please let me know! -- Paul Mundt <le...@li...> Index: 00-INDEX =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/fb/00-INDEX,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- 00-INDEX 14 Jan 2001 20:05:28 -0000 1.1.1.1 +++ 00-INDEX 9 Apr 2002 16:55:41 -0000 1.2 @@ -17,6 +17,8 @@ - info on the Cirrus Logic frame buffer driver matroxfb.txt - info on the Matrox frame buffer driver +pvr2fb.txt + - info on the PowerVR 2 frame buffer driver tgafb.txt - info on the TGA (DECChip 21030) frame buffer driver vesafb.txt Index: clgenfb.txt =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/fb/clgenfb.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- clgenfb.txt 14 Jan 2001 20:05:34 -0000 1.1.1.1 +++ clgenfb.txt 9 Apr 2002 16:55:41 -0000 1.2 @@ -35,11 +35,18 @@ At the moment, there are two kernel command line arguments supported: mode:640x480 +mode:800x600 or mode:1024x768 Full support for startup video modes (modedb) will be integrated soon. +Version 1.9.9.1 +--------------- +* Fix memory detection for 512kB case +* 800x600 mode +* Fixed timings +* Hint for AXP: Use -accel false -vyres -1 when changing resolution Version 1.9.4.4 Index: framebuffer.txt =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/fb/framebuffer.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- framebuffer.txt 14 Jan 2001 20:05:31 -0000 1.1.1.1 +++ framebuffer.txt 9 Apr 2002 16:55:41 -0000 1.2 @@ -2,7 +2,7 @@ ----------------------- Maintained by Geert Uytterhoeven <ge...@li...> -Last revised: January 2, 2000 +Last revised: May 10, 2001 0. Introduction @@ -296,7 +296,7 @@ For more specific information about the frame buffer device and its applications, please refer to the Linux-fbdev website: - http://www.linux-fbdev.org/ + http://linux-fbdev.sourceforge.net/ and to the following documentation: @@ -312,13 +312,13 @@ 8. Mailing list --------------- -There's a _development_ mailing list at lin...@vu..., -controlled by majordomo. Send an email with `help' in the message body to -ma...@vu... for subscription information. +There are several frame buffer device related mailing lists at SourceForge: + - lin...@li..., for announcements, + - lin...@li..., for generic user support, + - lin...@li..., for project developers. -The mailing list is archived at - - http://www.mail-archive.com/lin...@vu.../ +Point your web browser to http://sourceforge.net/projects/linux-fbdev/ for +subscription information and archive browsing. 9. Downloading Index: matroxfb.txt =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/fb/matroxfb.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- matroxfb.txt 14 Jan 2001 20:05:34 -0000 1.1.1.1 +++ matroxfb.txt 9 Apr 2002 16:55:41 -0000 1.2 @@ -173,9 +173,9 @@ mtrr - enables write combining on frame buffer. It speeds up video accesses much. It is default. You must have MTRR support enabled in kernel and your CPU must have MTRR (f.e. Pentium II have them). -sgram - tells to driver that you have G200 with SGRAM memory. It has no +sgram - tells to driver that you have Gxx0 with SGRAM memory. It has no effect without `init'. -sdram - tells to driver that you have G200 with SDRAM memory. +sdram - tells to driver that you have Gxx0 with SDRAM memory. It is a default. inv24 - change timings parameters for 24bpp modes on Millenium and Millenium II. Specify this if you see strange color shadows around @@ -216,6 +216,13 @@ secondary (TV) output - if DFP is active, TV output must be inactive and vice versa. DFP always uses same timing as primary (monitor) output. +dfp:X - use settings X for digital flat panel interface. X is number from + 0 to 0xFF, and meaning of each individual bit is described in + G400 manual, in description of DAC register 0x1F. For normal operation + you should set all bits to zero, except lowest bit. This lowest bit + selects who is source of display clocks, whether G400, or panel. + Default value is now read back from hardware - so you should specify + this value only if you are also using `init' parameter. vesa:X - selects startup videomode. X is number from 0 to 0x1FF, see table above for detailed explanation. Default is 640x480x8bpp if driver has 8bpp support. Otherwise first available of 640x350x4bpp, @@ -279,7 +286,9 @@ + 24bpp does not support correctly XF-FBDev on big-endian architectures. + interlaced text mode is not supported; it looks like hardware limitation, but I'm not sure. - + G200 SGRAM/SDRAM is not autodetected. + + Gxx0 SGRAM/SDRAM is not autodetected. + + If you are using more than one framebuffer device, you must boot kernel + with 'video=scrollback:0'. + maybe more... And following misfeatures: + SVGALib does not restore screen on exit. @@ -336,7 +345,7 @@ ACCEL, nofastfont 8x16 12x22 6x11 - Millennium I G200 Millennium I G200 Millennium I G200 + Millennium I G200 Millennium I G200 Millennium I G200 8bpp 7.79 7.24 13.55 7.78 30.00 21.01 16bpp 9.13 7.78 16.16 7.78 30.00 21.01 24bpp 14.17 10.72 18.69 10.24 34.99 21.01 @@ -344,7 +353,7 @@ ACCEL, fastfont 8x16 12x22 6x11 - Millennium I G200 Millennium I G200 Millennium I G200 + Millennium I G200 Millennium I G200 Millennium I G200 8bpp 8.41 6.01 6.54 4.37 16.00 10.51 16bpp 9.54 9.12 8.76 6.17 17.52 14.01 24bpp 15.00 12.36 11.67 10.00 22.01 18.32 @@ -355,6 +364,8 @@ Millennium I G200 TEXT 3.29 1.50 +* Yes, it is slower than Millennium I. + Dualhead G400 ============= @@ -376,7 +387,22 @@ + if you compiled it as module, you must insert i2c-matroxfb, matroxfb_maven and matroxfb_crtc2 into kernel. + +Dualhead G450 +============= +Driver supports dualhead G450 with some limitations: + + secondary head shares videomemory with primary head. It is not problem + if you have 32MB of videoram, but if you have only 16MB, you may have + to think twice before choosing videomode. + + due to hardware limitation, secondary head can use only 16 and 32bpp + videomodes. + + secondary head is not accelerated. + + secondary head always powerups in 640x480@60-32 videomode. You have to use + fbset to change this mode. + + TV output is not supported + + kernel is not fully multihead ready, so some things are impossible to do. + + if you compiled it as module, you must insert matroxfb_g450 and matroxfb_crtc2 + into kernel. -* Yes, it is slower than Millennium I. -- Petr Vandrovec <van...@vc...> Index: tgafb.txt =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/fb/tgafb.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 |
From: Andy P. <at...@us...> - 2002-04-09 17:08:23
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/filesystems/devfs In directory usw-pr-cvs1:/tmp/cvs-serv7449/filesystems/devfs Modified Files: ChangeLog README ToDo boot-options Log Message: synch 2.4.15 commit 28 Index: ChangeLog =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/filesystems/devfs/ChangeLog,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ChangeLog 14 Jan 2001 20:02:13 -0000 1.1.1.1 +++ ChangeLog 9 Apr 2002 16:55:41 -0000 1.2 @@ -495,7 +495,7 @@ - Replaced dummy .epoch inode with .devfsd character device -- Modified rc.devfs to take acount of above change +- Modified rc.devfs to take account of above change - Removed spurious driver warning messages when CONFIG_DEVFS_FS=n @@ -1613,3 +1613,168 @@ - Updated README from master HTML file - Ported to kernel 2.4.0-test3-pre4 (which had devfs-patch-v174) +=============================================================================== +Changes for patch v177 + +- Updated README from master HTML file + +- Documentation cleanups + +- Ensure <devfs_generate_path> terminates string for root entry + Thanks to Tim Jansen <ti...@tj...> + +- Exported <devfs_get_name> to modules + +- Make <devfs_mk_symlink> send events to devfsd + +- Cleaned up option processing in <devfs_setup> + +- Fixed bugs in handling symlinks: could leak or cause Oops + +- Cleaned up directory handling by separating fops + Thanks to Alexander Viro <vi...@ma...> +=============================================================================== +Changes for patch v178 + +- Fixed handling of inverted options in <devfs_setup> +=============================================================================== +Changes for patch v179 + +- Adjusted <try_modload> to account for <devfs_generate_path> fix +=============================================================================== +Changes for patch v180 + +- Fixed !CONFIG_DEVFS_FS stub declaration of <devfs_get_info> +=============================================================================== +Changes for patch v181 + +- Answered question posed by Al Viro and removed his comments from <devfs_open> + +- Moved setting of registered flag after other fields are changed + +- Fixed race between <devfsd_close> and <devfsd_notify_one> + +- Global VFS changes added bogus BKL to devfsd_close(): removed + +- Widened locking in <devfs_readlink> and <devfs_follow_link> + +- Replaced <devfsd_read> stack usage with <devfsd_ioctl> kmalloc + +- Simplified locking in <devfsd_ioctl> and fixed memory leak +=============================================================================== +Changes for patch v182 + +- Created <devfs_*alloc_major> and <devfs_*alloc_devnum> + +- Removed broken devnum allocation and use <devfs_alloc_devnum> + +- Fixed old devnum leak by calling new <devfs_dealloc_devnum> + +- Created <devfs_*alloc_unique_number> + +- Fixed number leak for /dev/cdroms/cdrom%d + +- Fixed number leak for /dev/discs/disc%d +=============================================================================== +Changes for patch v183 + +- Fixed bug in <devfs_setup> which could hang boot process +=============================================================================== +Changes for patch v184 + +- Documentation typo fix for fs/devfs/util.c + +- Fixed drivers/char/stallion.c for devfs + +- Added DEVFSD_NOTIFY_DELETE event + +- Updated README from master HTML file + +- Removed #include <asm/segment.h> from fs/devfs/base.c +=============================================================================== +Changes for patch v185 + +- Made <block_semaphore> and <char_semaphore> in fs/devfs/util.c + private + +- Fixed inode table races by removing it and using inode->u.generic_ip + instead + +- Moved <devfs_read_inode> into <get_vfs_inode> + +- Moved <devfs_write_inode> into <devfs_notify_change> +=============================================================================== +Changes for patch v186 + +- Fixed race in <devfs_do_symlink> for uni-processor + +- Updated README from master HTML file +=============================================================================== +Changes for patch v187 + +- Fixed drivers/char/stallion.c for devfs + +- Fixed drivers/char/rocket.c for devfs + +- Fixed bug in <devfs_alloc_unique_number>: limited to 128 numbers +=============================================================================== +Changes for patch v188 + +- Updated major masks in fs/devfs/util.c up to Linus' "no new majors" + proclamation. Block: were 126 now 122 free, char: were 26 now 19 free + +- Updated README from master HTML file + +- Removed remnant of multi-mount support in <devfs_mknod> + +- Removed unused DEVFS_FL_SHOW_UNREG flag +=============================================================================== +Changes for patch v189 + +- Removed nlink field from struct devfs_inode + +- Removed auto-ownership for /dev/pty/* (BSD ptys) and used + DEVFS_FL_CURRENT_OWNER|DEVFS_FL_NO_PERSISTENCE for /dev/pty/s* (just + like Unix98 pty slaves) and made /dev/pty/m* rw-rw-rw- access +=============================================================================== +Changes for patch v190 + +- Updated README from master HTML file + +- Replaced BKL with global rwsem to protect symlink data (quick and + dirty hack) +=============================================================================== +Changes for patch v191 + +- Replaced global rwsem for symlink with per-link refcount +=============================================================================== +Changes for patch v192 + +- Removed unnecessary #ifdef CONFIG_DEVFS_FS from arch/i386/kernel/mtrr.c + +- Ported to kernel 2.4.10-pre11 + +- Set inode->i_mapping->a_ops for block nodes in <get_vfs_inode> +=============================================================================== +Changes for patch v193 + +- Went back to global rwsem for symlinks (refcount scheme no good) +=============================================================================== +Changes for patch v194 + +- Fixed overrun in <devfs_link> by removing function (not needed) + +- Updated README from master HTML file +=============================================================================== +Changes for patch v195 + +- Fixed buffer underrun in <try_modload> + +- Moved down_read() from <search_for_entry_in_dir> to <find_entry> +=============================================================================== +Changes for patch v196 + +- Fixed race in <devfsd_ioctl> when setting event mask + Thanks to Kari Hurtta <hu...@le...> + +- Avoid deadlock in <devfs_follow_link> by using temporary buffer Index: README =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/filesystems/devfs/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- README 14 Jan 2001 20:02:20 -0000 1.1.1.1 +++ README 9 Apr 2002 16:55:41 -0000 1.2 @@ -3,7 +3,7 @@ Linux Devfs (Device File System) FAQ Richard Gooch -3-JUL-2000 +29-SEP-2001 ----------------------------------------------------------------------------- @@ -18,17 +18,14 @@ http://www.atnf.csiro.au/~rgooch/linux/ -NEWFLASH: The official 2.3.46 kernel has -included the devfs patch. Future patches will be released which -build on this. These patches are rolled into Linus' tree from time to -time. - A mailing list is available which you may subscribe to. Send email to maj...@os... with the following line in the body of the message: subscribe devfs -The list is archived at +To unsubscribe, send the message body: +unsubscribe devfs +instead. The list is archived at http://oss.sgi.com/projects/devfs/archive/. @@ -54,6 +51,7 @@ Other Issues Kernel Naming Scheme Devfsd Naming Scheme +Old Compatibility Names SCSI Host Probing Issues @@ -70,6 +68,8 @@ Other resources +Translations of this document + ----------------------------------------------------------------------------- @@ -81,7 +81,7 @@ name rather than major and minor numbers. These devices will appear in devfs automatically, with whatever default ownership and protection the driver specified. A daemon (devfsd) can be used to -override these defaults. +override these defaults. Devfs has been in the kernel since 2.3.46. NOTE that devfs is entirely optional. If you prefer the old disc-based device nodes, then simply leave CONFIG_DEVFS_FS=n (the @@ -99,6 +99,7 @@ can easily mount the root filesystem by referring to an entry in the devfs namespace. + The cost of devfs is a small increase in kernel code size and memory usage. About 7 pages of code (some of that in __init sections) and 72 bytes for each entry in the namespace. A modest system has only a @@ -157,6 +158,7 @@ of nodes. This means that changes in the kernel must be reflected by changes in the MAKEDEV programme, or else the system administrator creates device nodes by hand. + The basic problem is that there are two separate databases of major and minor numbers. One is in the kernel and one is in /dev (or in a MAKEDEV programme, if you want to look at it that way). This is @@ -192,6 +194,7 @@ 256 kBytes of /dev inodes, but you could argue that embedded systems would have hand-tuned /dev directories. I've had to do just that on my embedded systems, but I would rather just leave it to devfs. + Another issue is the time taken to lookup an inode when first referenced. Not only does this take time in scanning through a list in memory, but also the seek times to read the inodes off disc. @@ -212,7 +215,7 @@ likely be implemented in an ad-hoc fashion, as different drivers will provide their information in different ways. -Devfs is much cleaner, because it (natually) has a uniform mechanism +Devfs is much cleaner, because it (naturally) has a uniform mechanism to provide this information: the device nodes themselves! @@ -253,7 +256,7 @@ But why do that search at all if you don't have to? Once again, it seems pointless. -Note thate devfs doesn't use the major&minor system. For devfs +Note that devfs doesn't use the major&minor system. For devfs entries, the connection is done when you lookup the /dev entry. When devfs_register() is called, an internal table is appended which has the entry name and the file_operations. If the dentry cache doesn't @@ -274,9 +277,9 @@ /dev as a system administration tool Right now /dev contains a list of conceivable devices, most of which I -don't have. A devfs would only show those devices available on my -system. This means that listing /dev would be a handy way of checking -what devices were available. +don't have. Devfs only shows those devices available on my +system. This means that listing /dev is a handy way of checking what +devices are available. Major&minor size @@ -289,9 +292,9 @@ each device entry, which can be used to give an effective 32 bit device identifier (i.e. that's like having a 32 bit minor number). Since this is private to the kernel, there are no C library -compatibility which you would have with increasing major and minor -number sizes. See the section on "Allocation of Device Numbers" for -details on maintaining compatibility with userspace. +compatibility issues which you would have with increasing major and +minor number sizes. See the section on "Allocation of Device Numbers" +for details on maintaining compatibility with userspace. Solving this requires a kernel change. @@ -375,9 +378,9 @@ devfsd on any event, such as registration/unregistration of device entries, opening and closing devices, looking up inodes, scanning directories and more. This has many possibilities. Some of these are -already implemented. +already implemented. See: + -See: http://www.atnf.csiro.au/~rgooch/linux/ Device entry registration events can be used by devfsd to change @@ -414,6 +417,7 @@ requests. Instead of using kmod directly, the event is sent to devfsd which can implement an arbitrary authentication before loading the module itself. + Inode lookup events can also be used to construct arbitrary namespaces, without having to resort to populating devfs with symlinks to devices that don't exist. @@ -447,10 +451,10 @@ Who else does it? -FreeBSD has a devfs implementation. Solaris 2 has a pseudo-devfs -(something akin to scsidev but for all devices, with some unspecified -kernel support). BeOS, Plan9 and QNX also have it. SGI's IRIX 6.4 and -above also have a device filesystem. +FreeBSD has a devfs implementation. Solaris and AIX each have a +pseudo-devfs (something akin to scsidev but for all devices, with some +unspecified kernel support). BeOS, Plan9 and QNX also have it. SGI's +IRIX 6.4 and above also have a device filesystem. While we shouldn't just automatically do something because others do it, we should not ignore the work of others either. FreeBSD has a lot @@ -599,6 +603,20 @@ has problems with symbolic links. Append the following lines to your /etc/securetty file: +vc/1 +vc/2 +vc/3 +vc/4 +vc/5 +vc/6 +vc/7 +vc/8 + +This will not weaken security. If you have a version of util-linux +earlier than 2.10.h, please upgrade to 2.10.h or later. If you +absolutely cannot upgrade, then also append the following lines to +your /etc/securetty file: + 1 2 3 @@ -618,7 +636,8 @@ 4.0, as patches went in to make it more devfs-friendly. If you don't, you'll probably need to apply the following patch to /etc/security/console.perms so that ordinary users can run -startx. +startx. Note that not all distributions have this file (e.g. Debian), +so if it's not present, don't worry about it. --- /etc/security/console.perms.orig Sat Apr 17 16:26:47 1999 +++ /etc/security/console.perms Fri Feb 25 23:53:55 2000 @@ -627,17 +646,25 @@ # file classes -- these are regular expressions -<console>=tty[0-9][0-9]* :[0-9]\.[0-9] :[0-9] -+<console>=tty[0-9][0-9]* [0-9][0-9]* :[0-9]\.[0-9] :[0-9] ++<console>=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9] # device classes -- these are shell-style globs <floppy>=/dev/fd[0-1]* +If the patch does not apply, then change the line: + +<console>=tty[0-9][0-9]* :[0-9]\.[0-9] :[0-9] + +with: + +<console>=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9] + Disable devpts I've had a report of devpts mounted on /dev/pts not working correctly. Since devfs will also manage /dev/pts, there is no need to mount devpts as well. You should either edit your -/etc/fstab so devpts is not mounted, or disable devfs from +/etc/fstab so devpts is not mounted, or disable devpts from your kernel configuration. Unsupported drivers @@ -663,16 +690,27 @@ described above. The Kernel -Finally, you need to make sure devfs is compiled into your -kernel. Set CONFIG_DEVFS_FS=y and recompile your kernel. Next, you -need to make sure devfs is mounted. The best solution is to pass -devfs=mount at the kernel boot command line. You can edit -/etc/lilo.conf and add the line: - -append = "devfs=mount" - +Finally, you need to make sure devfs is compiled into your kernel. Set +CONFIG_EXPERIMENTAL=y, CONFIG_DEVFS_FS=y and CONFIG_DEVFS_MOUNT=y by +using favourite configuration tool (i.e. make config or +make xconfig) and then make dep; make clean and then +recompile your kernel and modules. At boot, devfs will be mounted onto +/dev. -This will make the kernel mount devfs at boot time onto /dev. +If you encounter problems booting (for example if you forgot a +configuration step), you can pass devfs=nomount at the kernel +boot command line. This will prevent the kernel from mounting devfs at +boot time onto /dev. + +In general, a kernel built with CONFIG_DEVFS_FS=y but without mounting +devfs onto /dev is completely safe, and requires no +configuration changes. One exception to take note of is when +LABEL= directives are used in /etc/fstab. In this +case you will be unable to boot properly. This is because the +mount(8) programme uses /proc/partitions as part of +the volume label search process, and the device names it finds are not +available, because setting CONFIG_DEVFS_FS=y changes the names in +/proc/partitions, irrespective of whether devfs is mounted. Now you've finished all the steps required. You're now ready to boot your shiny new kernel. Enjoy. @@ -701,7 +739,7 @@ permissions. It may be configured to record changes in permissions and will save them in a database (in fact a directory tree), and restore these upon boot. This is an efficient method and results in immediate -saving of current permissions (unlike the tar approach, which save +saving of current permissions (unlike the tar approach, which saves permissions at some unspecified future time). The default configuration file supplied with devfsd has config entries @@ -745,8 +783,11 @@ + add the following lines to your /etc/devfsd.conf file: +REGISTER ^pt[sy]/.* IGNORE +CHANGE ^pt[sy]/.* IGNORE REGISTER .* COPY /dev-state/$devname $devpath CHANGE .* COPY $devpath /dev-state/$devname CREATE .* COPY $devpath /dev-state/$devname @@ -758,6 +799,26 @@ +Permissions database stored in normal directory + +If you are using an older kernel which doesn't support VFS binding, +then you won't be able to have the permissions database in a +mounted-over /dev. However, you can still use a regular +directory to store the database. The sample /etc/devfsd.conf +file above may still be used. You will need to create the +/dev-state directory prior to installing devfsd. If you have +old permissions in /dev, then just copy (or move) the device +nodes over to the new directory. + +Which method is better? + +The best method is to have the permissions database stored in the +mounted-over /dev. This is because you will not need to copy +device nodes over to /dev-state, and because it allows you to +switch between devfs and non-devfs kernels, without requiring you to +copy permissions between /dev-state (for devfs) and +/dev (for non-devfs). + Dealing with drivers without devfs support @@ -910,13 +971,48 @@ configuration file is installed, which is used by the MODLOAD action. This should be sufficient for most configurations. If you require further configuration, edit your /etc/modules.conf -file. +file. The way module autoloading work with devfs is: + + +a process attempts to lookup a device node (e.g. /dev/fred) + + +if that device node does not exist, the full pathname is passed to +devfsd as a string + + +devfsd will pass the string to the modprobe programme (provided the +configuration line shown above is present), and specifies that +/etc/modules.devfs is the configuration file + + +/etc/modules.devfs includes /etc/modules.conf to +access local configurations + +modprobe will search it's configuration files, looking for an alias +that translates the pathname into a module name + + +the translated pathname is then used to load the module. + + +If you wanted a lookup of /dev/fred to load the +mymod module, you would require the following configuration +line in /etc/modules.conf: + +alias /dev/fred mymod + +The /etc/modules.devfs configuration file provides many such +aliases for standard device names. If you look closely at this file, +you will note that some modules require multiple alias configuration +lines. This is required to support module autoloading for old and new +device names. Mounting root off a devfs device If you wish to mount root off a devfs device when you pass the -"devfs=only" boot option, then you need to pass in the "root=" -option to the kernel when booting. If you use LILO, then you must have -this in lilo.conf: +"devfs=only" boot option, then you need to pass in the +"root=<device>" option to the kernel when booting. If you use +LILO, then you must have this in lilo.conf: append = "root=<device>" @@ -926,12 +1022,12 @@ root = <device> -then LILO will determine the device number of and will write -that device number into a special place in the kernel image before -starting the kernel, and the kernel will use that device number to -mount the root filesystem. So, using the "append" variety ensures that -LILO passes the root filesystem device as a string, which devfs can -then use. +then LILO will determine the device number of <device> and will +write that device number into a special place in the kernel image +before starting the kernel, and the kernel will use that device number +to mount the root filesystem. So, using the "append" variety ensures +that LILO passes the root filesystem device as a string, which devfs +can then use. Note that this isn't an issue if you don't pass "devfs=only". @@ -953,6 +1049,13 @@ directory tree that reflects the topology of available devices. The topological tree is useful for finding how your devices are arranged. +Below is a list of the naming schemes for the most common drivers. A +list of reserved device names is +available for reference. Please send email to +r...@at... to obtain an allocation. Please be +patient (the maintainer is busy). An alternative name may be allocated +instead of the requested name, at the discretion of the maintainer. + Disc Devices All discs, whether SCSI, IDE or whatever, are placed under the @@ -1067,7 +1170,8 @@ -------- -------- ----------- /dev/tts/{0,1,...} /dev/ttyS{0,1,...} Serial ports /dev/cua/{0,1,...} /dev/cua{0,1,...} Call out devices - /dev/vc/{0,1,...} /dev/tty{1...63} Virtual consoles + /dev/vc/0 /dev/tty Current virtual console + /dev/vc/{1,2,...} /dev/tty{1...63} Virtual consoles /dev/vcc/{0,1,...} /dev/vcs{1...63} Virtual consoles /dev/pty/m{0,1,...} /dev/ptyp?? PTY masters /dev/pty/s{0,1,...} /dev/ttyp?? PTY slaves @@ -1109,7 +1213,8 @@ cases, the kernel-supplied naming scheme is quite convenient, so devfsd does not provide another naming scheme. The convenience names that devfsd creates are in fact the same names as the original devfs -kernel patch created (before Linus mandated the Big Name Change). +kernel patch created (before Linus mandated the Big Name +Change). These are referred to as "new compatibility entries". In order to configure devfsd to create these convenience names, the following lines should be placed in your /etc/devfsd.conf: @@ -1198,6 +1303,24 @@ would appear as /dev/xd/c0t0. +Old Compatibility Names + +The old compatibility names are the legacy device names, such as +/dev/hda, /dev/sda, /dev/rtc and so on. +Devfsd can be configured to create compatibility symlinks so that you +may continue to use the old names in your configuration files and so +that old applications will continue to function correctly. + +In order to configure devfsd to create these legacy names, the +following lines should be placed in your /etc/devfsd.conf: + +REGISTER .* MKOLDCOMPAT +UNREGISTER .* RMOLDCOMPAT + +This will cause devfsd to create (and destroy) symbolic links which +point to the kernel-supplied names. + + SCSI Host Probing Issues Devfs allows you to identify SCSI discs based in part on SCSI host @@ -1220,14 +1343,15 @@ means that devices connected to -- first aha1542 controller - will be c0b#t#u# -- first parallel port ZIP - will be c1b#t#u# -- second aha1542 controller - will be c2b#t#u# -- first NCR53C7xx controller - will be c4b#t#u# -- any extra controller - will be c5b#t#u#, c6b#t#u#, etc +- first aha1542 controller - will be /dev/scsi/host0/bus#/target#/lun# +- first parallel port ZIP - will be /dev/scsi/host1/bus#/target#/lun# +- second aha1542 controller - will be /dev/scsi/host2/bus#/target#/lun# +- first NCR53C7xx controller - will be /dev/scsi/host4/bus#/target#/lun# +- any extra controller - will be /dev/scsi/host5/bus#/target#/lun#, + /dev/scsi/host6/bus#/target#/lun#, etc - if any of above controllers will not be found - the reserved names will not be used by any other device. -- c3b#t#u# names will never be used +- /dev/scsi/host3/bus#/target#/lun# names will never be used You can use ',' instead of ':' as the separator character if you @@ -1343,6 +1467,7 @@ Making things work Alternatives to devfs +What I don't like about devfs @@ -1379,6 +1504,47 @@ namespace, but have had no response. +How can I test if I have devfs compiled into my kernel? + +All filesystems built-in or currently loaded are listed in +/proc/filesystems. If you see a devfs entry, then +you know that devfs was compiled into your kernel. If you have +correctly configured and rebuilt your kernel, then devfs will be +built-in. If you think you've configured it in, but +/proc/filesystems doesn't show it, you've made a mistake. +Common mistakes include: + +Using a 2.2.x kernel without applying the devfs patch (if you +don't know how to patch your kernel, use 2.4.x instead, don't bother +asking me how to patch) +Forgetting to set CONFIG_EXPERIMENTAL=y +Forgetting to set CONFIG_DEVFS_FS=y +Forgetting to set CONFIG_DEVFS_MOUNT=y (if you want devfs +to be automatically mounted at boot) +Editing your .config manually, instead of using make +config or make xconfig +Forgetting to run make dep; make clean after changing the +configuration and before compiling +Forgetting to compile your kernel and modules +Forgetting to install your kernel +Forgetting to install your modules + +Please check twice that you've done all these steps before sending in +a bug report. + + + +How can I test if devfs is mounted on /dev? + +The device filesystem will always create an entry called +".devfsd", which is used to communicate with the daemon. Even +if the daemon is not running, this entry will exist. Testing for the +existence of this entry is the approved method of determining if devfs +is mounted or not. Note that the type of entry (i.e. regular file, +character device, named pipe, etc.) may change without notice. Only +the existence of the entry should be relied upon. + + @@ -1518,6 +1684,54 @@ + +What I don't like about devfs + +Here are some common complaints about devfs, and some suggestions and +solutions that may make it more palatable for you. I can't please +everybody, but I do try :-) + +I hate the naming scheme + +First, remember that no naming scheme will please everybody. You hate +the scheme, others love it. Who's to say who's right and who's wrong? +Ultimately, the person who writes the code gets to choose, and what +exists now is a combination of the the choices made by the +devfs author and the +kernel maintainer (Linus). + +However, not all is lost. If you want to create your own naming +scheme, it is a simple matter to write a standalone script, hack +devfsd, or write a script called by devfsd. You can create whatever +naming scheme you like. + +Further, if you want to remove all traces of the devfs naming scheme +from /dev, you can mount devfs elsewhere (say +/devfs) and populate /dev with links into +/devfs. This population can be automated using devfsd if you +wish. + +You can even use the VFS binding facility to make the links, rather +than using symbolic links. This way, you don't even have to see the +"destination" of these symbolic links. + +Devfs puts policy into the kernel + +There's already policy in the kernel. Device numbers are in fact +policy (why should the kernel dictate what device numbers I use?). +Face it, some policy has to be in the kernel. The real difference +between device names as policy and device numbers as policy is that +no one will use device numbers directly, because device +numbers are devoid of meaning to humans and are ugly. At least with +the devfs device names, (even though you can add your own naming +scheme) some people will use the devfs-supplied names directly. This +offends some people :-) + +Devfs is bloatware + +This is not even remotely true. As shown above, +both code and data size are quite modest. + ----------------------------------------------------------------------------- @@ -1539,7 +1753,7 @@ Douglas Gilbert has written yet another useful document at -http://www.torque.net/scsi/linux_scsi_24/ which +http://www.torque.net/scsi/SCSI-2.4-HOWTO/ which discusses the Linux SCSI subsystem in 2.4. @@ -1550,6 +1764,31 @@ http://johannes.erdfelt.com/hotswap.txt. Johannes has promised a HTML version will follow. + + +I presented an invited +paper +at the + +2nd Annual Storage Management Workshop held in Miamia, Florida, +U.S.A. in October 2000. + + + + +----------------------------------------------------------------------------- + + +Translations of this document + +This document has been translated into other languages. + + + + +A Korean translation by via...@no... is available at + +http://home.nownuri.net/~viatoris/devfs/devfs.html Index: ToDo =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/filesystems/devfs/ToDo,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ToDo 14 Jan 2001 20:02:21 -0000 1.1.1.1 +++ ToDo 9 Apr 2002 16:55:41 -0000 1.2 @@ -32,7 +32,7 @@ - MFM hard drive (drivers/acorn/block/mfmhd.c) -- I2O block device (drivers/i2o/i2o_block.c) +- I2O block device (drivers/message/i2o/i2o_block.c) - ST-RAM device (arch/m68k/atari/stram.c) Index: boot-options =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/filesystems/devfs/boot-options,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- boot-options 14 Jan 2001 20:02:21 -0000 1.1.1.1 +++ boot-options 9 Apr 2002 16:55:41 -0000 1.2 @@ -4,7 +4,7 @@ Richard Gooch <rg...@at...> - 30-APR-2000 + 18-AUG-2001 When CONFIG_DEVFS_DEBUG is enabled, you can pass several boot options @@ -19,6 +19,8 @@ devfs=dmod,dreg +You may prefix "no" to any option. This will invert the option. + Debugging Options ================= @@ -42,11 +44,11 @@ dilookup print inode lookup requests -diread print inode reads +diget print VFS inode allocations diunlink print inode unlinks -diwrite print inode writes +dichange print inode changes dimknod print calls to mknod(2) @@ -58,10 +60,6 @@ These control the default behaviour of devfs. The options are: -show show unregistered devices by default - mount mount devfs onto /dev at boot time - -nomount do not mount devfs onto /dev at boot time only disable non-devfs device nodes for devfs-capable drivers |
From: Andy P. <at...@us...> - 2002-04-09 17:08:23
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/cris In directory usw-pr-cvs1:/tmp/cvs-serv7449/cris Modified Files: README Log Message: synch 2.4.15 commit 28 Index: README =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/cris/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- README 25 Feb 2001 23:15:25 -0000 1.1.1.1 +++ README 9 Apr 2002 16:55:41 -0000 1.2 @@ -2,19 +2,27 @@ ================================== $Id$ -This is a port of Linux 2.4 to Axis Communications ETRAX 100LX embedded network CPU. For -more information about CRIS and ETRAX please see further below. +This is a port of Linux 2.4 to Axis Communications ETRAX 100LX embedded +network CPU. For more information about CRIS and ETRAX please see further +below. + +In order to compile this you need a version of gcc with support for the +ETRAX chip family. Please see this link for more information on how to +download the compiler and other tools useful when building and booting +software for the ETRAX platform: -<... to come: instructions on how to grab the right gcc, compiling and booting ...> +http://developer.axis.com/doc/software/devboard_lx/install-howto.html +<more specific information should come in this document later> What is CRIS ? -------------- -CRIS is an acronym for 'Code Reduced Instruction Set'. It is the CPU architecture in Axis -Communication AB's range of embedded network CPU's, called ETRAX. The latest CPU is called -ETRAX 100LX, where LX stands for 'Linux' because the chip was designed to be a good host for -the Linux operating system. +CRIS is an acronym for 'Code Reduced Instruction Set'. It is the CPU +architecture in Axis Communication AB's range of embedded network CPU's, +called ETRAX. The latest CPU is called ETRAX 100LX, where LX stands for +'Linux' because the chip was designed to be a good host for the Linux +operating system. The ETRAX 100LX chip -------------------- @@ -23,8 +31,8 @@ http://www.axis.com/news/us/001101_etrax.htm -The ETRAX 100LX is a 100 MIPS processor with 8kB cache, MMU, and a very broad range of -built-in interfaces, all with modern scatter/gather DMA. +The ETRAX 100LX is a 100 MIPS processor with 8kB cache, MMU, and a very broad +range of built-in interfaces, all with modern scatter/gather DMA. Memory interfaces: @@ -44,40 +52,41 @@ * two parallel-ports * two generic 8-bit ports - (not all interfaces are available at the same time due to chip pin multiplexing) + (not all interfaces are available at the same time due to chip pin + multiplexing) -The previous version of the ETRAX, the ETRAX 100, sits in almost all of Axis shipping -thin-servers like the Axis 2100 web camera or the developer-board. It lacks an MMU so the -Linux we run on that is a version of uClinux (Linux 2.0 without MM-support) ported to the CRIS -architecture. The new Linux 2.4 port has full MM and needs a CPU with an MMU, so it will not -run on the ETRAX 100. - -A version of the Axis developer-board with ETRAX 100LX will be available as soon as the chip -is ramped up (please see http://developer.axis.com for further information on that). +The previous version of the ETRAX, the ETRAX 100, sits in almost all of +Axis shipping thin-servers like the Axis 2100 web camera or the ETRAX 100 +developer-board. It lacks an MMU so the Linux we run on that is a version +of uClinux (Linux 2.0 without MM-support) ported to the CRIS architecture. +The new Linux 2.4 port has full MM and needs a CPU with an MMU, so it will +not run on the ETRAX 100. +A version of the Axis developer-board with ETRAX 100LX (running Linux +2.4) is now available. For more information please see developer.axis.com. Bootlog ------- -Just as an example, this is the debug-output from a boot of Linux 2.4 on an Axis -developer-board with ETRAX 100LX. The displayed BogoMIPS value is 5 times too small :) +Just as an example, this is the debug-output from a boot of Linux 2.4 on +a board with ETRAX 100LX. The displayed BogoMIPS value is 5 times too small :) At the end you see some user-mode programs booting like telnet and ftp daemons. -Linux version 2.4.0-test11 (bj...@go...) (gcc version 2.96 20000427 (experimental)) #358 Wed Nov 22 19:29:15 CET 2000 -ROM fs in RAM, size 368640 bytes +Linux version 2.4.1 (bj...@go...) (gcc version 2.96 20000427 (experimental)) #207 Wed Feb 21 15:48:15 CET 2001 +ROM fs in RAM, size 1376256 bytes Setting up paging and the MMU. -On node 0 totalpages: 1024 -zone(0): 1024 pages. +On node 0 totalpages: 2048 +zone(0): 2048 pages. zone(1): 0 pages. zone(2): 0 pages. -Linux/CRIS port (c) 2000 Axis Communications AB +Linux/CRIS port on ETRAX 100LX (c) 2001 Axis Communications AB Kernel command line: -Calibrating delay loop... 19.92 BogoMIPS -Memory: 6864k/8192k available (531k kernel code, 1328k reserved, 85k data, 24k init) +Calibrating delay loop... 19.91 BogoMIPS +Memory: 13872k/16384k available (587k kernel code, 2512k reserved, 44k data, 24k init) kmem_create: Forcing size word alignment - vm_area_struct kmem_create: Forcing size word alignment - filp -Dentry-cache hash table entries: 1024 (order: 0, 8192 bytes) +Dentry-cache hash table entries: 2048 (order: 1, 16384 bytes) Buffer-cache hash table entries: 2048 (order: 0, 8192 bytes) Page-cache hash table entries: 2048 (order: 0, 8192 bytes) kmem_create: Forcing size word alignment - kiobuf @@ -87,10 +96,10 @@ POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 -kmem_create: Forcing size word alignment - skbuff_head_cache Starting kswapd v1.8 kmem_create: Forcing size word alignment - file lock cache kmem_create: Forcing size word alignment - blkdev_requests +block: queued sectors max/low 9109kB/3036kB, 64 slots per queue ETRAX 100LX 10/100MBit ethernet v2.0 (c) 2000 Axis Communications AB eth0 initialized eth0: changed MAC to 00:40:8C:CD:00:00 @@ -99,29 +108,40 @@ ttyS1 at 0xb0000068 is a builtin UART with DMA ttyS2 at 0xb0000070 is a builtin UART with DMA ttyS3 at 0xb0000078 is a builtin UART with DMA +Axis flash mapping: 200000 at 50000000 +Axis flash: Found 1 x16 CFI device at 0x0 in 16 bit mode + Amd/Fujitsu Extended Query Table v1.0 at 0x0040 +Axis flash: JEDEC Device ID is 0xC4. Assuming broken CFI table. +Axis flash: Swapping erase regions for broken CFI table. +number of CFI chips: 1 + Using default partition table +I2C driver v2.2, (c) 1999-2001 Axis Communications AB +ETRAX 100LX GPIO driver v2.1, (c) 2001 Axis Communications AB NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP kmem_create: Forcing size word alignment - ip_dst_cache IP: routing cache hash table of 1024 buckets, 8Kbytes -TCP: Hash tables configured (established 1024 bind 1024) +TCP: Hash tables configured (established 2048 bind 2048) NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Mounted root (cramfs filesystem) readonly. Init starts up... +Mounted none on /proc ok. Setting up eth0 with ip 10.13.9.116 and mac 00:40:8c:18:04:60 eth0: changed MAC to 00:40:8C:18:04:60 Setting up lo with ip 127.0.0.1 Default gateway is 10.13.9.1 Hostname is bbox1 Telnetd starting, using port 23. - using /bin/sh as shell. -sftpd[14]: sftpd $Revision$ starting up + using /bin/sash as shell. +sftpd[15]: sftpd $Revision$ starting up + And here is how some /proc entries look: 17# cd /proc 17# cat cpuinfo -cpu : ETRAX +cpu : CRIS cpu revision : 10 cpu model : ETRAX 100LX cache size : 8 kB @@ -133,6 +153,7 @@ ata : yes usb : yes bogomips : 99.84 + 17# cat meminfo total: used: free: shared: buffers: cached: Mem: 7028736 925696 6103040 114688 0 229376 |
From: Andy P. <at...@us...> - 2002-04-09 17:08:22
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/s390x/tools/silo In directory usw-pr-cvs1:/tmp/cvs-serv13825/s390x/tools/silo Removed Files: Makefile cfg.c cfg.h silo.c silo.conf Log Message: synch 2.4.15 commit 29 --- Makefile DELETED --- --- cfg.c DELETED --- --- cfg.h DELETED --- --- silo.c DELETED --- --- silo.conf DELETED --- |
From: Andy P. <at...@us...> - 2002-04-09 17:08:20
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/s390x/mm In directory usw-pr-cvs1:/tmp/cvs-serv13825/s390x/mm Modified Files: extable.c fault.c init.c ioremap.c Log Message: synch 2.4.15 commit 29 Index: extable.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390x/mm/extable.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- extable.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ extable.c 9 Apr 2002 17:03:18 -0000 1.2 @@ -10,6 +10,7 @@ #include <linux/config.h> #include <linux/module.h> +#include <linux/spinlock.h> #include <asm/uaccess.h> extern const struct exception_table_entry __start___ex_table[]; @@ -36,26 +37,32 @@ return 0; } +extern spinlock_t modlist_lock; + unsigned long search_exception_table(unsigned long addr) { - unsigned long ret; + unsigned long ret = 0; + unsigned long flags; #ifndef CONFIG_MODULES /* There is only the kernel to search. */ ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr); - if (ret) return FIX_PSW(ret); + return ret; #else /* The kernel is the last "module" -- no need to treat it special. */ struct module *mp; + + spin_lock_irqsave(&modlist_lock, flags); for (mp = module_list; mp != NULL; mp = mp->next) { - if (mp->ex_table_start == NULL) + if (mp->ex_table_start == NULL || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING))) continue; ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, addr); - if (ret) return FIX_PSW(ret); + if (ret) + break; } + spin_unlock_irqrestore(&modlist_lock, flags); + return ret; #endif - - return 0; } Index: fault.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390x/mm/fault.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- fault.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ fault.c 9 Apr 2002 17:03:18 -0000 1.2 @@ -4,6 +4,7 @@ * S390 version * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Hartmut Penner (hp...@de...) + * Ulrich Weigand (uwe...@de...) * * Derived from "arch/i386/mm/fault.c" * Copyright (C) 1995 Linus Torvalds @@ -21,6 +22,8 @@ #include <linux/mm.h> #include <linux/smp.h> #include <linux/smp_lock.h> +#include <linux/init.h> +#include <linux/console.h> #include <asm/system.h> #include <asm/uaccess.h> @@ -32,6 +35,34 @@ #endif extern void die(const char *,struct pt_regs *,long); +static void force_sigsegv(struct task_struct *tsk, int code, void *address); + +extern spinlock_t timerlist_lock; + +/* + * Unlock any spinlocks which will prevent us from getting the + * message out (timerlist_lock is acquired through the + * console unblank code) + */ +void bust_spinlocks(int yes) +{ + spin_lock_init(&timerlist_lock); + if (yes) { + oops_in_progress = 1; + } else { + int loglevel_save = console_loglevel; + oops_in_progress = 0; + console_unblank(); + /* + * OK, the message is on the console. Now we call printk() + * without oops_in_progress set so that printk will give klogd + * a poke. Hold onto your hats... + */ + console_loglevel = 15; + printk(" "); + console_loglevel = loglevel_save; + } +} /* * This routine handles page faults. It determines the address, @@ -52,18 +83,31 @@ unsigned long address; unsigned long fixup; int write; - unsigned long psw_mask; - unsigned long psw_addr; int si_code = SEGV_MAPERR; int kernel_address = 0; - /* - * get psw mask of Program old psw to find out, - * if user or kernel mode - */ + tsk = current; + mm = tsk->mm; + + /* + * Check for low-address protection. This needs to be treated + * as a special case because the translation exception code + * field is not guaranteed to contain valid data in this case. + */ + if ((error_code & 0xff) == 4 && !(S390_lowcore.trans_exc_code & 4)) { - psw_mask = S390_lowcore.program_old_psw.mask; - psw_addr = S390_lowcore.program_old_psw.addr; + /* Low-address protection hit in kernel mode means + NULL pointer write access in kernel mode. */ + if (!(regs->psw.mask & PSW_PROBLEM_STATE)) { + address = 0; + kernel_address = 1; + goto no_context; + } + + /* Low-address protection hit in user mode 'cannot happen'. */ + die ("Low-address protection", regs, error_code); + do_exit(SIGKILL); + } /* * get the failing address @@ -73,11 +117,6 @@ address = S390_lowcore.trans_exc_code&-4096L; - tsk = current; - mm = tsk->mm; - - if (in_interrupt() || !mm) - goto no_context; /* * Check which address space the address belongs to @@ -108,6 +147,7 @@ } } die("page fault via unknown access register", regs, error_code); + do_exit(SIGKILL); break; case 2: /* Secondary Segment Table Descriptor */ @@ -116,19 +156,25 @@ break; } + /* + * Check whether we have a user MM in the first place. + */ + if (in_interrupt() || !mm || !(regs->psw.mask & _PSW_IO_MASK_BIT)) + goto no_context; /* * When we get here, the fault happened in the current - * task's user address space, so we search the VMAs + * task's user address space, so we can switch on the + * interrupts again and then search the VMAs */ - down(&mm->mmap_sem); + __sti(); + + down_read(&mm->mmap_sem); vma = find_vma(mm, address); - if (!vma) { - printk("no vma for address %lX\n",address); + if (!vma) goto bad_area; - } if (vma->vm_start <= address) goto good_area; if (!(vma->vm_flags & VM_GROWSDOWN)) @@ -158,6 +204,7 @@ goto bad_area; } + survive: /* * If for any reason at all we couldn't handle the fault, * make sure we exit gracefully rather than endlessly redo @@ -176,7 +223,7 @@ goto out_of_memory; } - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); return; /* @@ -184,11 +231,10 @@ * Fix it, but check if it's kernel or user first.. */ bad_area: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); /* User mode accesses just cause a SIGSEGV */ - if (psw_mask & PSW_PROBLEM_STATE) { - struct siginfo si; + if (regs->psw.mask & PSW_PROBLEM_STATE) { tsk->thread.prot_addr = address; tsk->thread.trap_no = error_code; #ifndef CONFIG_SYSCTL @@ -205,10 +251,8 @@ show_regs(regs); } #endif - si.si_signo = SIGSEGV; - si.si_code = si_code; - si.si_addr = (void*) address; - force_sig_info(SIGSEGV, &si, tsk); + + force_sigsegv(tsk, si_code, (void *)address); return; } @@ -223,6 +267,7 @@ * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ + if (kernel_address) printk(KERN_ALERT "Unable to handle kernel pointer dereference" " at virtual kernel address %016lx\n", address); @@ -230,10 +275,6 @@ printk(KERN_ALERT "Unable to handle kernel paging request" " at virtual user address %016lx\n", address); -/* - * need to define, which information is useful here - */ - die("Oops", regs, error_code); do_exit(SIGKILL); @@ -243,14 +284,20 @@ * us unable to handle the page fault gracefully. */ out_of_memory: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); + if (tsk->pid == 1) { + tsk->policy |= SCHED_YIELD; + schedule(); + down_read(&mm->mmap_sem); + goto survive; + } printk("VM: killing process %s\n", tsk->comm); - if (psw_mask & PSW_PROBLEM_STATE) + if (regs->psw.mask & PSW_PROBLEM_STATE) do_exit(SIGKILL); goto no_context; do_sigbus: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); /* * Send a sigbus, regardless of whether we were in kernel @@ -261,6 +308,158 @@ force_sig(SIGBUS, tsk); /* Kernel mode? Handle exceptions or die */ - if (!(psw_mask & PSW_PROBLEM_STATE)) + if (!(regs->psw.mask & PSW_PROBLEM_STATE)) goto no_context; } + +/* + * Send SIGSEGV to task. This is an external routine + * to keep the stack usage of do_page_fault small. + */ +static void force_sigsegv(struct task_struct *tsk, int code, void *address) +{ + struct siginfo si; + si.si_signo = SIGSEGV; + si.si_code = code; + si.si_addr = address; + force_sig_info(SIGSEGV, &si, tsk); +} + + +#ifdef CONFIG_PFAULT +/* + * 'pfault' pseudo page faults routines. + */ +static int pfault_disable = 0; + +static int __init nopfault(char *str) +{ + pfault_disable = 1; + return 1; +} + +__setup("nopfault", nopfault); + +typedef struct { + __u16 refdiagc; + __u16 reffcode; + __u16 refdwlen; + __u16 refversn; + __u64 refgaddr; + __u64 refselmk; + __u64 refcmpmk; + __u64 reserved; +} __attribute__ ((packed)) pfault_refbk_t; + +typedef struct _pseudo_wait_t { + struct _pseudo_wait_t *next; + wait_queue_head_t queue; + unsigned long address; + int resolved; +} pseudo_wait_t; + +int pfault_init(void) +{ + pfault_refbk_t refbk = + { 0x258, 0, 5, 2, __LC_KERNEL_STACK, 1ULL << 48, 1ULL << 48, + 0x8000000000000000ULL }; + int rc; + + if (pfault_disable) + return -1; + __asm__ __volatile__( + " diag %1,%0,0x258\n" + "0: j 2f\n" + "1: la %0,8\n" + "2:\n" + ".section __ex_table,\"a\"\n" + " .align 4\n" + " .quad 0b,1b\n" + ".previous" + : "=d" (rc) : "a" (&refbk) : "cc" ); + __ctl_set_bit(0, 9); + return rc; +} + +void pfault_fini(void) +{ + pfault_refbk_t refbk = + { 0x258, 1, 5, 2, 0ULL, 0ULL, 0ULL, 0ULL }; + + if (pfault_disable) + return; + __ctl_clear_bit(0, 9); + __asm__ __volatile__( + " diag %0,0,0x258\n" + "0:\n" + ".section __ex_table,\"a\"\n" + " .align 4\n" + " .quad 0b,0b\n" + ".previous" + : : "a" (&refbk) : "cc" ); +} + +asmlinkage void +pfault_interrupt(struct pt_regs *regs, __u16 error_code) +{ + struct task_struct *tsk; + wait_queue_head_t queue; + wait_queue_head_t *qp; + __u16 subcode; + + /* + * Get the external interruption subcode & pfault + * initial/completion signal bit. VM stores this + * in the 'cpu address' field associated with the + * external interrupt. + */ + subcode = S390_lowcore.cpu_addr; + if ((subcode & 0xff00) != 0x0600) + return; + + /* + * Get the token (= address of kernel stack of affected task). + */ + tsk = (struct task_struct *) + (*((unsigned long *) __LC_PFAULT_INTPARM) - THREAD_SIZE); + + /* + * We got all needed information from the lowcore and can + * now safely switch on interrupts. + */ + if (regs->psw.mask & PSW_PROBLEM_STATE) + __sti(); + + if (subcode & 0x0080) { + /* signal bit is set -> a page has been swapped in by VM */ + qp = (wait_queue_head_t *) + xchg(&tsk->thread.pfault_wait, -1); + if (qp != NULL) { + /* Initial interrupt was faster than the completion + * interrupt. pfault_wait is valid. Set pfault_wait + * back to zero and wake up the process. This can + * safely be done because the task is still sleeping + * and can't procude new pfaults. */ + tsk->thread.pfault_wait = 0ULL; + wake_up(qp); + } + } else { + /* signal bit not set -> a real page is missing. */ + init_waitqueue_head (&queue); + qp = (wait_queue_head_t *) + xchg(&tsk->thread.pfault_wait, (addr_t) &queue); + if (qp != NULL) { + /* Completion interrupt was faster than the initial + * interrupt (swapped in a -1 for pfault_wait). Set + * pfault_wait back to zero and exit. This can be + * done safely because tsk is running in kernel + * mode and can't produce new pfaults. */ + tsk->thread.pfault_wait = 0ULL; + } + + /* go to sleep */ + wait_event(queue, tsk->thread.pfault_wait == 0ULL); + } +} +#endif + Index: init.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390x/mm/init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- init.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ init.c 9 Apr 2002 17:03:18 -0000 1.2 @@ -35,143 +35,32 @@ #include <asm/pgalloc.h> #include <asm/dma.h> #include <asm/lowcore.h> +#include <asm/tlb.h> -static unsigned long totalram_pages; +mmu_gather_t mmu_gathers[NR_CPUS]; -/* - * empty_bad_page is the page that is used for page faults when linux - * is out-of-memory. Older versions of linux just did a - * do_exit(), but using this instead means there is less risk - * for a process dying in kernel mode, possibly leaving an inode - * unused etc.. - * - * empty_bad_pte_table is the accompanying page-table: it is initialized - * to point to BAD_PAGE entries. - * - * empty_bad_pmd_table is the accompanying segment table: it is initialized - * to point to empty_bad_pte_table page tables. - * - * ZERO_PAGE is a special page that is used for zero-initialized - * data and COW. - */ +static unsigned long totalram_pages; pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); -char empty_bad_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); -pmd_t empty_bad_pmd_table[PTRS_PER_PMD] __attribute__((__aligned__(PAGE_SIZE))); -pte_t empty_bad_pte_table[PTRS_PER_PTE] __attribute__((__aligned__(PAGE_SIZE))); - -static int test_access(unsigned long loc) -{ - static const int ssm_mask = 0x07000000L; - int rc, i; - - rc = 0; - for (i=0; i<2; i++) { - __asm__ __volatile__( - " slgr %0,%0\n" - " ssm %1\n" - " tprot 0(%2),0\n" - "0: jne 1f\n" - " lghi %0,1\n" - "1: ssm %3\n" - ".section __ex_table,\"a\"\n" - " .align 8\n" - " .quad 0b,1b\n" - ".previous" - : "+&d" (rc) : "i" (0), "a" (loc), "m" (ssm_mask) - : "cc"); - if (rc == 0) - break; - loc += 0x100000; - } - return rc; -} - -static pmd_t *get_bad_pmd_table(void) -{ - pmd_t v; - int i; - - pmd_set(&v, empty_bad_pte_table); - - for (i = 0; i < PTRS_PER_PMD; i++) - empty_bad_pmd_table[i] = v; - - return empty_bad_pmd_table; -} - -static pte_t *get_bad_pte_table(void) -{ - pte_t v; - int i; - - v = pte_mkdirty(mk_pte_phys(__pa(empty_bad_page), PAGE_SHARED)); - - for (i = 0; i < PAGE_SIZE/sizeof(pte_t); i++) - empty_bad_pte_table[i] = v; - - return empty_bad_pte_table; -} - -pmd_t * -get_pmd_slow(pgd_t *pgd, unsigned long offset) -{ - pmd_t *pmd; - int i; - - pmd = (pmd_t *) __get_free_pages(GFP_KERNEL,2); - if (pgd_none(*pgd)) { - if (pmd) { - for (i = 0; i < PTRS_PER_PMD; i++) - pmd_clear(pmd+i); - pgd_set(pgd, pmd); - return pmd + offset; - } - pmd = (pmd_t *) get_bad_pmd_table(); - pgd_set(pgd, pmd); - return NULL; - } - free_pages((unsigned long)pmd,2); - if (pgd_bad(*pgd)) - BUG(); - return (pmd_t *) pgd_page(*pgd) + offset; -} - -pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset) -{ - pte_t *pte; - int i; - - pte = (pte_t*) __get_free_page(GFP_KERNEL); - if (pmd_none(*pmd)) { - if (pte) { - for (i=0;i<PTRS_PER_PTE;i++) - pte_clear(pte+i); - pmd_set(pmd,pte); - return pte + offset; - } - pte = (pte_t*) get_bad_pte_table(); - pmd_set(pmd,pte); - return NULL; - } - free_page(__pa(pte)); - if (pmd_bad(*pmd)) - BUG(); - return (pte_t *) pmd_page(*pmd) + offset; -} int do_check_pgt_cache(int low, int high) { int freed = 0; if(pgtable_cache_size > high) { do { - if(pgd_quicklist) - free_pgd_slow(get_pgd_fast()), freed += 4; - if(pmd_quicklist) - free_pmd_slow(get_pmd_fast()), freed += 4; - if(pte_quicklist) - free_pte_slow(get_pte_fast()), freed++; + if(pgd_quicklist) { + free_pgd_slow(get_pgd_fast()); + freed += 4; + } + if(pmd_quicklist) { + pmd_free_slow(pmd_alloc_one_fast(NULL, 0)); + freed += 4; + } + if(pte_quicklist) { + pte_free_slow(pte_alloc_one_fast(NULL, 0)); + freed += 1; + } } while(pgtable_cache_size > low); } return freed; @@ -229,7 +118,7 @@ int i,j,k; unsigned long address=0; unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | - _REGION_TABLE; + _KERN_REGION_TABLE; unsigned long end_mem = (unsigned long) __va(max_low_pfn*PAGE_SIZE); static const int ssm_mask = 0x04000000L; @@ -259,34 +148,34 @@ for (i = 0 ; i < PTRS_PER_PGD ; i++,pg_dir++) { if (address >= end_mem) { - pgd_clear(pg_dir); - continue; + pgd_clear(pg_dir); + continue; } pm_dir = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE*4); - pgd_set(pg_dir,pm_dir); + pgd_populate(&init_mm, pg_dir, pm_dir); for (j = 0 ; j < PTRS_PER_PMD ; j++,pm_dir++) { - if (address >= end_mem) { - pmd_clear(pm_dir); - continue; - } - + if (address >= end_mem) { + pmd_clear(pm_dir); + continue; + } + pt_dir = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); - pmd_set(pm_dir,pt_dir); + pmd_populate(&init_mm, pm_dir, pt_dir); for (k = 0 ; k < PTRS_PER_PTE ; k++,pt_dir++) { - pte = mk_pte_phys(address, PAGE_KERNEL); - if (address >= end_mem) { - pte_clear(&pte); - continue; - } - set_pte(pt_dir, pte); - address += PAGE_SIZE; + pte = mk_pte_phys(address, PAGE_KERNEL); + if (address >= end_mem) { + pte_clear(&pte); + continue; + } + set_pte(pt_dir, pte); + address += PAGE_SIZE; } } } - + /* enable virtual mapping in kernel mode */ __asm__ __volatile__("lctlg 1,1,%0\n\t" "lctlg 7,7,%0\n\t" @@ -302,7 +191,6 @@ void __init mem_init(void) { unsigned long codesize, reservedpages, datasize, initsize; - unsigned long tmp; max_mapnr = num_physpages = max_low_pfn; high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); @@ -313,25 +201,7 @@ /* this will put all low memory onto the freelists */ totalram_pages += free_all_bootmem(); - /* mark usable pages in the mem_map[] and count reserved pages */ reservedpages = 0; - tmp = 0; - do { - if (tmp && (tmp & 0x1ff) == 0 && - test_access(tmp * PAGE_SIZE) == 0) { - printk("2M Segment 0x%016lX not available\n", - tmp * PAGE_SIZE); - do { - set_bit(PG_reserved, &mem_map[tmp].flags); - reservedpages++; - tmp++; - } while (tmp < max_low_pfn && (tmp & 0x1ff)); - } else { - if (PageReserved(mem_map+tmp)) - reservedpages++; - tmp++; - } - } while (tmp < max_low_pfn); codesize = (unsigned long) &_etext - (unsigned long) &_text; datasize = (unsigned long) &_edata - (unsigned long) &_etext; Index: ioremap.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390x/mm/ioremap.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ioremap.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ ioremap.c 9 Apr 2002 17:03:18 -0000 1.2 @@ -54,7 +54,7 @@ if (address >= end) BUG(); do { - pte_t * pte = pte_alloc_kernel(pmd, address); + pte_t * pte = pte_alloc(&init_mm, pmd, address); if (!pte) return -ENOMEM; remap_area_pte(pte, address, end - address, address + phys_addr, flags); @@ -67,6 +67,7 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr, unsigned long size, unsigned long flags) { + int error; pgd_t * dir; unsigned long end = address + size; @@ -75,17 +76,21 @@ flush_cache_all(); if (address >= end) BUG(); + spin_lock(&init_mm.page_table_lock); do { - pmd_t *pmd = pmd_alloc_kernel(dir, address); + pmd_t *pmd; + pmd = pmd_alloc(&init_mm, dir, address); + error = -ENOMEM; if (!pmd) - return -ENOMEM; + break; if (remap_area_pmd(pmd, address, end - address, phys_addr + address, flags)) - return -ENOMEM; - set_pgdir(address, *dir); + break; + error = 0; address = (address + PGDIR_SIZE) & PGDIR_MASK; dir++; } while (address && (address < end)); + spin_unlock(&init_mm.page_table_lock); flush_tlb_all(); return 0; } |
From: Andy P. <at...@us...> - 2002-04-09 17:08:19
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/s390x/tools/dasdfmt In directory usw-pr-cvs1:/tmp/cvs-serv13825/s390x/tools/dasdfmt Removed Files: Makefile dasdfmt.8 dasdfmt.c Log Message: synch 2.4.15 commit 29 --- Makefile DELETED --- --- dasdfmt.8 DELETED --- --- dasdfmt.c DELETED --- |
From: Andy P. <at...@us...> - 2002-04-09 17:08:19
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/s390x/lib In directory usw-pr-cvs1:/tmp/cvs-serv13825/s390x/lib Modified Files: Makefile delay.c Added Files: misaligned.c Log Message: synch 2.4.15 commit 29 --- NEW FILE --- /* * arch/s390/lib/misaligned.c * S390 misalignment panic stubs * * S390 version * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Martin Schwidefsky (sch...@de...). * * xchg wants to panic if the pointer is not aligned. To avoid multiplying * the panic message over and over again, the panic is done in the helper * functions __misaligned_u64, __misaligned_u32 and __misaligned_u16. */ #include <linux/module.h> #include <linux/kernel.h> void __misaligned_u16(void) { panic("misaligned (__u16 *) in __xchg\n"); } void __misaligned_u32(void) { panic("misaligned (__u32 *) in __xchg\n"); } void __misaligned_u64(void) { panic("misaligned (__u64 *) in __xchg\n"); } EXPORT_SYMBOL(__misaligned_u16); EXPORT_SYMBOL(__misaligned_u32); EXPORT_SYMBOL(__misaligned_u64); Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390x/lib/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ Makefile 9 Apr 2002 17:03:18 -0000 1.2 @@ -12,7 +12,8 @@ L_TARGET = lib.a -obj-y = checksum.o delay.o memset.o strcmp.o strncpy.o uaccess.o +obj-y = checksum.o delay.o memset.o misaligned.o strcmp.o strncpy.o uaccess.o +export-objs += misaligned.o include $(TOPDIR)/Rules.make Index: delay.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/s390x/lib/delay.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- delay.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ delay.c 9 Apr 2002 17:03:18 -0000 1.2 @@ -1,5 +1,5 @@ /* - * arch/s390/kernel/delay.c + * arch/s390x/kernel/delay.c * Precise Delay Loops for S390 * * S390 version |
From: Andy P. <at...@us...> - 2002-04-09 17:08:16
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/isdn In directory usw-pr-cvs1:/tmp/cvs-serv7449/isdn Modified Files: 00-INDEX HiSax.cert INTERFACE INTERFACE.fax README README.HiSax README.act2000 README.audio README.eicon README.hysdn README.icn Log Message: synch 2.4.15 commit 28 Index: 00-INDEX =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/00-INDEX,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- 00-INDEX 14 Jan 2001 20:04:04 -0000 1.1.1.1 +++ 00-INDEX 9 Apr 2002 16:55:45 -0000 1.2 @@ -40,4 +40,4 @@ _ info for running X.25 over ISDN. README.hysdn - info on driver for Hypercope active HYSDN cards - \ No newline at end of file + Index: HiSax.cert =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/HiSax.cert,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- HiSax.cert 14 Jan 2001 20:04:13 -0000 1.1.1.1 +++ HiSax.cert 9 Apr 2002 16:55:45 -0000 1.2 @@ -20,6 +20,23 @@ version and the tested hardware. Any changes to the HiSax source code may therefore affect the certification. +Additional ITU approval tests have been carried out for all generic cards +using Colognechip single chip solutions HFC-S PCI A for PCI cards as well +as HFC-S USB based USB ISDN ta adapters. +These tests included all layers 1-3 and as well all functional tests for +the layer 1. Because all hardware based on these chips are complete ISDN +solutions in one chip all cards and USB-TAs using these chips are to be +regarded as approved for those tests. Some additional electrical tests +of the layer 1 which are independant of the driver and related to a +special hardware used will be regarded as approved if at least one +solution has been tested including those electrical tests. So if cards +or tas have been completely approved for any other os, the approval +for those electrical tests is valid for linux, too. +Please send any questions regarding this drivers or approval abouts to +w...@is... +Additional information and the type approval documents will be found +shortly on the Colognechip website www.colognechip.com + If you change the main files of the HiSax ISDN stack, the certification will become invalid. Because in most countries it is illegal to connect unapproved ISDN equipment to the public network, I have to guarantee that @@ -50,6 +67,7 @@ drivers/isdn/hisax/cert.c drivers/isdn/hisax/elsa.c drivers/isdn/hisax/diva.c +drivers/isdn/hisax/hfc_pci.c Please send any changes, bugfixes and patches to me rather than implementing them directly into the HiSax sources. Index: INTERFACE =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/INTERFACE,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- INTERFACE 25 Feb 2001 23:15:24 -0000 1.1.1.2 +++ INTERFACE 9 Apr 2002 16:55:45 -0000 1.2 @@ -481,7 +481,7 @@ driver = driver-Id command = ISDN_CMD_PROT_IO arg = The lower 8 Bits define the addressed protocol as defined - in ISDN_PTYPE..., the upper bits are used to differenciate + in ISDN_PTYPE..., the upper bits are used to differentiate the protocol specific CMD. para = protocol and function specific. See isdnif.h for detail. Index: INTERFACE.fax =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/INTERFACE.fax,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: README =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- README 14 Jan 2001 20:04:00 -0000 1.1.1.1 +++ README 9 Apr 2002 16:55:45 -0000 1.2 @@ -276,6 +276,8 @@ 1 = Add CPN to RING message on Bit 1: 0 = Add CPN to FCON message off 1 = Add CPN to FCON message on + Bit 2: 0 = Add CDN to RING/FCON message off + 1 = Add CDN to RING/FCON message on Last but not least a (at the moment fairly primitive) device to request the line-status (/dev/isdninfo) is made available. Index: README.HiSax =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/README.HiSax,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- README.HiSax 25 Feb 2001 23:15:24 -0000 1.1.1.2 +++ README.HiSax 9 Apr 2002 16:55:45 -0000 1.2 @@ -69,12 +69,7 @@ Note: PCF, PCF-Pro: up to now, only the ISDN part is supported PCC-8: not tested yet - Teles PCMCIA is EXPERIMENTAL - Teles 16.3c is EXPERIMENTAL - Teles PCI is EXPERIMENTAL - Teles S0Box is EXPERIMENTAL Eicon.Diehl Diva U interface not tested - HFC-S+, HFC-SP/PCMCIA are experimental If you know other passive cards with the Siemens chipset, please let me know. To use the PNP cards you need the isapnptools. Index: README.act2000 =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/README.act2000,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: README.audio =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/README.audio,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: README.eicon =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/README.eicon,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- README.eicon 14 Jan 2001 20:04:13 -0000 1.1.1.1 +++ README.eicon 9 Apr 2002 16:55:45 -0000 1.2 @@ -100,17 +100,6 @@ the necessary D-Channel traces for isdnlog. -FILECHECK: -A part of the eicon driver source code files are provided -by Eicon Technology. In order to get the best support from Eicon, -these files are tested with a checksum, just to know if the files -were modified. This does *not* mean, you are not allowed to modify the -driver. If you want to improve the driver or you fix a bug, please do -so and let me (or Eicon) know, about the necessary changes. So -every user knows, if the driver he uses is modified or checked with -Eicon files. When the driver has been loaded, in the syslog you will -find something like "verified" or "modified" right after the version. - Thanks to Deutsche Mailbox Saar-Lor-Lux GmbH Index: README.hysdn =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/README.hysdn,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 Index: README.icn =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Documentation/isdn/README.icn,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 |
From: Andy P. <at...@us...> - 2002-04-09 17:08:14
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed In directory usw-pr-cvs1:/tmp/cvs-serv13825/cris/boot/compressed Modified Files: Makefile README decompress.ld head.S misc.c Log Message: synch 2.4.15 commit 29 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ Makefile 9 Apr 2002 17:03:15 -0000 1.2 @@ -16,12 +16,15 @@ all: vmlinuz -vmlinuz: piggy.img $(OBJECTS) - $(LD) -mcriself -T decompress.ld -o decompress.o $(OBJECTS) +decompress.bin: $(OBJECTS) + $(LD) -T decompress.ld -o decompress.o $(OBJECTS) $(OBJCOPY) -O binary --remove-section=.bss decompress.o decompress.bin # save it for mkprod in the topdir. cp decompress.bin $(TOPDIR) - cat decompress.bin piggy.img $(TOPDIR)/cramfs.img > vmlinuz + + +vmlinuz: piggy.img decompress.bin + cat decompress.bin piggy.img > vmlinuz rm -f piggy.img head.o: head.S Index: README =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: decompress.ld =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/decompress.ld,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- decompress.ld 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ decompress.ld 9 Apr 2002 17:03:15 -0000 1.2 @@ -1,3 +1,5 @@ +OUTPUT_FORMAT(elf32-us-cris) + MEMORY { dram : ORIGIN = 0x40700000, Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/head.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- head.S 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ head.S 9 Apr 2002 17:03:15 -0000 1.2 @@ -1,7 +1,7 @@ /* - * arch/etrax100/boot/compressed/head.S + * arch/cris/boot/compressed/head.S * - * Copyright (C) 1999 Axis Communications AB + * Copyright (C) 1999, 2001 Axis Communications AB * * Code that sets up the DRAM registers, calls the * decompressor to unpack the piggybacked kernel, and jumps. @@ -12,6 +12,8 @@ #define ASSEMBLER_MACROS_ONLY #include <asm/sv_addr_ag.h> +#define RAM_INIT_MAGIC 0x56902387 + ;; Exported symbols .globl _input_data @@ -22,23 +24,29 @@ nop di -#ifndef CONFIG_SVINTO_SIM - - ;; We need to setup the bus registers before we start using the DRAM +;; We need to initialze DRAM registers before we start using the DRAM + + cmp.d RAM_INIT_MAGIC, r8 ; Already initialized? + beq dram_init_finished + nop + +#include "../../lib/dram_init.S" + +dram_init_finished: + + ;; Initiate the PA and PB ports - move.d DEF_R_WAITSTATES, r0 - move.d r0, [R_WAITSTATES] + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0 + move.b r0, [R_PORT_PA_DATA] - move.d DEF_R_BUS_CONFIG, r0 - move.d r0, [R_BUS_CONFIG] - - move.d DEF_R_DRAM_CONFIG, r0 - move.d r0, [R_DRAM_CONFIG] + move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0 + move.b r0, [R_PORT_PA_DIR] - move.d DEF_R_DRAM_TIMING, r0 - move.d r0, [R_DRAM_TIMING] + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0 + move.b r0, [R_PORT_PB_DATA] -#endif + move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0 + move.b r0, [R_PORT_PB_DIR] ;; Setup the stack to a suitably high address. ;; We assume 8 MB is the minimum DRAM in an eLinux @@ -70,6 +78,7 @@ move.d r5, [_input_data] ; for the decompressor + ;; Clear the decompressors BSS (between _edata and _end) moveq 0, r0 @@ -81,20 +90,22 @@ nop ;; Do the decompression and save compressed size in _inptr - - jsr _decompress_kernel - ;; Put start address of cramfs in r9 so the kernel can use it + jsr _decompress_kernel + + ;; Put start address of root partition in r9 so the kernel can use it ;; when mounting from flash move.d [_input_data], r9 ; flash address of compressed kernel add.d [_inptr], r9 ; size of compressed kernel - + ;; Enter the decompressed kernel - + move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized jump 0x40004000 ; kernel is linked to this address .data _input_data: .dword 0 ; used by the decompressor + +#include "../../lib/hw_settings.S" Index: misc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/boot/compressed/misc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- misc.c 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ misc.c 9 Apr 2002 17:03:15 -0000 1.2 @@ -13,7 +13,7 @@ */ /* where the piggybacked kernel image expects itself to live. - * it is the same address we use when we network load an uncompressed + * it is the same adress we use when we network load an uncompressed * image into DRAM, and it is the address the kernel is linked to live * at by etrax100.ld. */ @@ -21,6 +21,7 @@ #define KERNEL_LOAD_ADR 0x40004000 #include <linux/config.h> + #include <linux/types.h> #include <asm/svinto.h> @@ -143,21 +144,21 @@ static void puts(const char *s) { -#ifndef CONFIG_DEBUG_PORT_NULL +#ifndef CONFIG_ETRAX_DEBUG_PORT_NULL while(*s) { -#ifdef CONFIG_DEBUG_PORT0 +#ifdef CONFIG_ETRAX_DEBUG_PORT0 while(!(*R_SERIAL0_STATUS & (1 << 5))) ; *R_SERIAL0_TR_DATA = *s++; #endif -#ifdef CONFIG_DEBUG_PORT1 +#ifdef CONFIG_ETRAX_DEBUG_PORT1 while(!(*R_SERIAL1_STATUS & (1 << 5))) ; *R_SERIAL1_TR_DATA = *s++; #endif -#ifdef CONFIG_DEBUG_PORT2 +#ifdef CONFIG_ETRAX_DEBUG_PORT2 while(!(*R_SERIAL2_STATUS & (1 << 5))) ; *R_SERIAL2_TR_DATA = *s++; #endif -#ifdef CONFIG_DEBUG_PORT3 +#ifdef CONFIG_ETRAX_DEBUG_PORT3 while(!(*R_SERIAL3_STATUS & (1 << 5))) ; *R_SERIAL3_TR_DATA = *s++; #endif @@ -227,33 +228,45 @@ void decompress_kernel() { + char revision; + /* input_data is set in head.S */ inbuf = input_data; -#ifdef CONFIG_DEBUG_PORT0 +#ifdef CONFIG_ETRAX_DEBUG_PORT0 *R_SERIAL0_XOFF = 0; *R_SERIAL0_BAUD = 0x99; *R_SERIAL0_TR_CTRL = 0x40; #endif -#ifdef CONFIG_DEBUG_PORT1 +#ifdef CONFIG_ETRAX_DEBUG_PORT1 *R_SERIAL1_XOFF = 0; *R_SERIAL1_BAUD = 0x99; *R_SERIAL1_TR_CTRL = 0x40; #endif -#ifdef CONFIG_DEBUG_PORT2 +#ifdef CONFIG_ETRAX_DEBUG_PORT2 + *R_GEN_CONFIG = 0x08; *R_SERIAL2_XOFF = 0; *R_SERIAL2_BAUD = 0x99; *R_SERIAL2_TR_CTRL = 0x40; #endif -#ifdef CONFIG_DEBUG_PORT3 +#ifdef CONFIG_ETRAX_DEBUG_PORT3 + *R_GEN_CONFIG = 0x100; *R_SERIAL3_XOFF = 0; *R_SERIAL3_BAUD = 0x99; *R_SERIAL3_TR_CTRL = 0x40; #endif - + setup_normal_output_buffer(); makecrc(); + + __asm__ volatile ("move vr,%0" : "=rm" (revision)); + if (revision < 10) + { + puts("You need an ETRAX 100LX to run linux 2.4\n"); + while(1); + } + puts("Uncompressing Linux...\n"); gunzip(); puts("Done. Now booting the kernel.\n"); |
From: Andy P. <at...@us...> - 2002-04-09 17:08:13
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/cris In directory usw-pr-cvs1:/tmp/cvs-serv13825/cris Modified Files: Makefile README.mm config.in cris.ld defconfig Log Message: synch 2.4.15 commit 29 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ Makefile 9 Apr 2002 17:03:15 -0000 1.2 @@ -25,32 +25,40 @@ # regenerating stuff (even for incremental linking of subsystems!) is # even more nauseating. LD = if [ ! -e $(LD_SCRIPT).tmp -o $(LD_SCRIPT) -nt $(LD_SCRIPT).tmp ]; then \ - sed -e s/@ETRAX_DRAM_BASE@/0x$(ETRAX_DRAM_BASE)/ \ - -e s/@ETRAX_DRAM_SIZE_M@/$(ETRAX_DRAM_SIZE)/ \ + sed -e s/@CONFIG_ETRAX_DRAM_VIRTUAL_BASE@/0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)/ \ + -e s/@CONFIG_ETRAX_DRAM_SIZE_M@/$(CONFIG_ETRAX_DRAM_SIZE)/ \ < $(LD_SCRIPT) > $(LD_SCRIPT).tmp; \ else true; \ - fi && $(CROSS_COMPILE)ld -mcriself + fi && $(CROSS_COMPILE)gcc -mlinux -nostdlib -LINKFLAGS =-qmagic -mcriself -T $(LD_SCRIPT).tmp +LINKFLAGS = -mlinux -T $(LD_SCRIPT).tmp # objcopy is used to make binary images from the resulting linked file OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S # normally, gcc on a linux box adds __linux__ but we do it "manually" -# gcc-cris defaults to a.out, we need ELF, so -melf +# -mlinux enables -march=v10, -fno-underscores among others -CFLAGS := $(CFLAGS) -march=v10 -fno-strict-aliasing -pipe -D__linux__ +CFLAGS := $(CFLAGS) -mlinux -fno-strict-aliasing -pipe -D__linux__ -ifdef CONFIG_KGDB +ifdef CONFIG_ETRAX_KGDB CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g CFLAGS += -fno-omit-frame-pointer endif +AFLAGS += -mlinux + HEAD := arch/cris/kernel/head.o SUBDIRS += arch/cris/kernel arch/cris/mm arch/cris/lib arch/cris/drivers -CORE_FILES += arch/cris/kernel/kernel.o arch/cris/mm/mm.o arch/cris/drivers/drivers.o +ifdef CONFIG_ETRAX_AXISFLASHMAP +# only build this if axis flash map is used, because they depend on +# each others config options +SUBDIRS += arch/cris/boot/rescue +endif +CORE_FILES += arch/cris/kernel/kernel.o arch/cris/mm/mm.o +DRIVERS += arch/cris/drivers/drivers.o LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a) LIBS := $(TOPDIR)/arch/cris/lib/lib.a $(LIBS) $(TOPDIR)/arch/cris/lib/lib.a $(LIBGCC) @@ -76,10 +84,18 @@ cramfs: ## cramfs - Creates a cramfs image - mkcramfs -p 8192 root cramfs.img + mkcramfs -b 8192 -m romfs_meta.txt root cramfs.img cat vmlinux.bin cramfs.img >timage -zImage: vmlinux +clinux: vmlinux.bin decompress.bin rescue.bin + +decompress.bin: dummy + @make -C arch/cris/boot/compressed decompress.bin + +rescue.bin: dummy + @make -C arch/cris/boot/rescue rescue.bin + +zImage: vmlinux.bin ## zImage - Compressed kernel (gzip) @$(MAKEBOOT) zImage Index: README.mm =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/README.mm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- README.mm 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ README.mm 9 Apr 2002 17:03:15 -0000 1.2 @@ -3,8 +3,8 @@ HISTORY: $Log$ -Revision 1.1.1.1 2001/02/25 23:15:23 kenn -Import official 2.4.2 Linus tree +Revision 1.2 2002/04/09 17:03:15 atp +synch 2.4.15 commit 29 Revision 1.1 2000/07/10 16:25:21 bjornw Initial revision Index: config.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/config.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- config.in 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ config.in 9 Apr 2002 17:03:15 -0000 1.2 @@ -5,6 +5,8 @@ mainmenu_name "Linux/CRIS Kernel Configuration" define_bool CONFIG_UID16 y +define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y +define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n mainmenu_option next_comment comment 'Code maturity level options' @@ -12,48 +14,57 @@ endmenu mainmenu_option next_comment +comment 'Loadable module support' +bool 'Enable loadable module support' CONFIG_MODULES +if [ "$CONFIG_MODULES" = "y" ]; then + bool ' Set version information on all module symbols' CONFIG_MODVERSIONS + bool ' Kernel module loader' CONFIG_KMOD +fi +endmenu + +mainmenu_option next_comment comment 'General setup' bool 'Networking support' CONFIG_NET bool 'System V IPC' CONFIG_SYSVIPC +bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT +bool 'Sysctl support' CONFIG_SYSCTL tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - tristate 'Kernel support for JAVA binaries' CONFIG_BINFMT_JAVA -fi -bool 'Use kernel gdb debugger' CONFIG_KGDB +bool 'Use kernel gdb debugger' CONFIG_ETRAX_KGDB bool 'Enable Etrax100 watchdog' CONFIG_ETRAX_WATCHDOG -bool 'Use serial console (on the debug port)' CONFIG_USE_SERIAL_CONSOLE - -bool 'Use in-kernel ifconfig/route setup' CONFIG_KERNEL_IFCONFIG - endmenu mainmenu_option next_comment comment 'Hardware setup' choice 'Processor type' \ - "Etrax-100-LX CONFIG_ETRAX100LX \ - Etrax-100-LX-for-xsim-simulator CONFIG_SVINTO_SIM" Etrax-100-LX - -# For both LX version 1 and the current simulator we enable the low VM mapping -# Later when LX version 2 and above exist, this should be done with an if - -define_bool CONFIG_CRIS_LOW_MAP y + "Etrax-100-LX-v1 CONFIG_ETRAX100LX \ + Etrax-100-LX-v2 CONFIG_ETRAX100LX_V2 \ + Etrax-100-LX-for-xsim-simulator CONFIG_SVINTO_SIM" Etrax-100-LX-v1 + +# Etrax100 LX v1 has a MMU "feature" requiring a low mapping + +if [ "$CONFIG_ETRAX100LX" = "y" ]; then + define_bool CONFIG_CRIS_LOW_MAP y + define_hex CONFIG_ETRAX_DRAM_VIRTUAL_BASE 60000000 +else + define_hex CONFIG_ETRAX_DRAM_VIRTUAL_BASE c0000000 +fi -hex 'DRAM base (hex)' ETRAX_DRAM_BASE 40000000 -int 'DRAM size (dec, in MB)' ETRAX_DRAM_SIZE 8 +int 'DRAM size (dec, in MB)' CONFIG_ETRAX_DRAM_SIZE 8 -int 'Max possible flash size (dec, in MB)' CONFIG_ETRAX_FLASH_LENGTH 2 int 'Buswidth of flash in bytes' CONFIG_ETRAX_FLASH_BUSWIDTH 2 +string 'Root device name' CONFIG_ETRAX_ROOT_DEVICE "/dev/mtdblock3" + choice 'Product LED port' \ "Port-PA-LEDs CONFIG_ETRAX_PA_LEDS \ Port-PB-LEDs CONFIG_ETRAX_PB_LEDS \ - Mem-0x90000000-LEDs CONFIG_ETRAX_90000000_LEDS \ + Port-CSP0-LEDs CONFIG_ETRAX_CSP0_LEDS \ None CONFIG_ETRAX_NO_LEDS" Port-PA-LEDs if [ "$CONFIG_ETRAX_NO_LEDS" != "y" ]; then @@ -61,46 +72,67 @@ int ' First red LED bit' CONFIG_ETRAX_LED1R 3 int ' Second green LED bit' CONFIG_ETRAX_LED2G 4 int ' Second red LED bit' CONFIG_ETRAX_LED2R 5 - int ' Third green LED bit' CONFIG_ETRAX_LED3R 2 - int ' Third red LED bit' CONFIG_ETRAX_LED3G 2 + int ' Third green LED bit' CONFIG_ETRAX_LED3G 2 + int ' Third red LED bit' CONFIG_ETRAX_LED3R 2 fi +if [ "$CONFIG_ETRAX_CSP0_LEDS" = "y" ]; then + int ' Fourth red LED bit' CONFIG_ETRAX_LED4R 2 + int ' Fourth green LED bit' CONFIG_ETRAX_LED4G 2 + int ' Fifth red LED bit' CONFIG_ETRAX_LED5R 2 + int ' Fifth green LED bit' CONFIG_ETRAX_LED5G 2 + int ' Sixth red LED bit' CONFIG_ETRAX_LED6R 2 + int ' Sixth green LED bit' CONFIG_ETRAX_LED6G 2 + int ' Seventh red LED bit' CONFIG_ETRAX_LED7R 2 + int ' Seventh green LED bit' CONFIG_ETRAX_LED7G 2 + int ' Eigth yellow LED bit' CONFIG_ETRAX_LED8Y 2 + int ' Ninth yellow LED bit' CONFIG_ETRAX_LED9Y 2 + int ' Tenth yellow LED bit' CONFIG_ETRAX_LED10Y 2 + int ' Eleventh yellow LED bit' CONFIG_ETRAX_LED11Y 2 + int ' Twelfth red LED bit' CONFIG_ETRAX_LED12R 2 +fi + choice 'Product debug-port' \ - "Serial-0 CONFIG_DEBUG_PORT0 \ - Serial-1 CONFIG_DEBUG_PORT1 \ - Serial-2 CONFIG_DEBUG_PORT2 \ - Serial-3 CONFIG_DEBUG_PORT3" Serial-0 - -hex 'R_WAITSTATES' DEF_R_WAITSTATES 95a6 -hex 'R_BUS_CONFIG' DEF_R_BUS_CONFIG 104 -hex 'R_DRAM_CONFIG' DEF_R_DRAM_CONFIG 1a200040 -hex 'R_DRAM_TIMING' DEF_R_DRAM_TIMING 5611 -hex 'R_PORT_PA_DIR' DEF_R_PORT_PA_DIR 1c -hex 'R_PORT_PA_DATA' DEF_R_PORT_PA_DATA 00 -hex 'R_PORT_PB_CONFIG' DEF_R_PORT_PB_CONFIG 00 -hex 'R_PORT_PB_DIR' DEF_R_PORT_PB_DIR 00 -hex 'R_PORT_PB_DATA' DEF_R_PORT_PB_DATA ff + "Serial-0 CONFIG_ETRAX_DEBUG_PORT0 \ + Serial-1 CONFIG_ETRAX_DEBUG_PORT1 \ + Serial-2 CONFIG_ETRAX_DEBUG_PORT2 \ + Serial-3 CONFIG_ETRAX_DEBUG_PORT3 \ + disabled CONFIG_ETRAX_DEBUG_PORT_NULL" Serial-0 + +choice 'Product rescue-port' \ + "Serial-0 CONFIG_ETRAX_RESCUE_SER0 \ + Serial-1 CONFIG_ETRAX_RESCUE_SER1 \ + Serial-2 CONFIG_ETRAX_RESCUE_SER2 \ + Serial-3 CONFIG_ETRAX_RESCUE_SER3" Serial-0 + +hex 'R_WAITSTATES' CONFIG_ETRAX_DEF_R_WAITSTATES 95a6 +hex 'R_BUS_CONFIG' CONFIG_ETRAX_DEF_R_BUS_CONFIG 104 + +bool 'SDRAM support' CONFIG_ETRAX_SDRAM +if [ "$CONFIG_ETRAX_SDRAM" = "n" ]; then + hex 'R_DRAM_CONFIG' CONFIG_ETRAX_DEF_R_DRAM_CONFIG 1a200040 + hex 'R_DRAM_TIMING' CONFIG_ETRAX_DEF_R_DRAM_TIMING 5611 +fi + +if [ "$CONFIG_ETRAX_SDRAM" = "y" ]; then + hex 'R_SDRAM_CONFIG' CONFIG_ETRAX_DEF_R_SDRAM_CONFIG d2fa7878 + hex 'R_SDRAM_TIMING' CONFIG_ETRAX_DEF_R_SDRAM_TIMING 80004801 +fi + +hex 'R_PORT_PA_DIR' CONFIG_ETRAX_DEF_R_PORT_PA_DIR 1c +hex 'R_PORT_PA_DATA' CONFIG_ETRAX_DEF_R_PORT_PA_DATA 00 +hex 'R_PORT_PB_CONFIG' CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG 00 +hex 'R_PORT_PB_DIR' CONFIG_ETRAX_DEF_R_PORT_PB_DIR 00 +hex 'R_PORT_PB_DATA' CONFIG_ETRAX_DEF_R_PORT_PB_DATA ff + +bool 'Software Shutdown Support' CONFIG_ETRAX_SOFT_SHUTDOWN +if [ "$CONFIG_ETRAX_SOFT_SHUTDOWN" = "y" ]; then + int 'Shutdown bit on port CSP0' CONFIG_ETRAX_SHUTDOWN_BIT 12 + int 'Power button bit on port G' CONFIG_ETRAX_POWERBUTTON_BIT 25 +fi endmenu -# only configure IP numbers if the kernel ifconfig/route setup is enabled - -if [ "$CONFIG_KERNEL_IFCONFIG" = "y" ]; then - mainmenu_option next_comment - comment 'IP address selection' - - comment 'All addresses are in hexadecimal form without 0x prefix' - - hex 'IP address' ELTEST_IPADR ab1005af - hex 'Network' ELTEST_NETWORK ab100000 - hex 'Netmask' ELTEST_NETMASK ffff0000 - hex 'Broadcast' ELTEST_BROADCAST ab10ffff - hex 'Gateway' ELTEST_GATEWAY ab100101 - hwaddr 'Ethernet address' ELTEST_ETHADR 00408ccd0000 - - endmenu -fi - # bring in Etrax built-in drivers source arch/cris/drivers/Config.in @@ -148,7 +180,7 @@ source drivers/ieee1394/Config.in -source drivers/i2o/Config.in +source drivers/message/i2o/Config.in if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment @@ -198,8 +230,6 @@ source drivers/media/Config.in source fs/Config.in - -source drivers/char/Config.in mainmenu_option next_comment comment 'Sound' Index: cris.ld =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/cris.ld,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- cris.ld 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ cris.ld 9 Apr 2002 17:03:15 -0000 1.2 @@ -1,38 +1,47 @@ /* ld script to make the Linux/CRIS kernel * Authors: Bjorn Wesen (bj...@ax...) * - * For now, on Etrax-100 LX, the DRAM starts virtually at 0x6. Normally - * it should be at 0xc. + * It is VERY DANGEROUS to fiddle around with the symbols in this + * script. It is for example quite vital that all generated sections + * that are used are actually named here, otherwise the linker will + * put them at the end, where the init stuff is which is FREED after + * the kernel has booted. */ SECTIONS { - . = 0x60000000; /* DRAM starts virtually at 0x60000000 */ - _dram_start = .; - _ibr_start = .; + . = @CONFIG_ETRAX_DRAM_VIRTUAL_BASE@; + dram_start = .; + ibr_start = .; . = . + 0x4000; /* see head.S and pages reserved at the start */ _text = .; /* Text and read-only data */ - _text_start = .; /* lots of aliases */ + text_start = .; /* lots of aliases */ _stext = .; __stext = .; .text : { *(.text) *(.fixup) *(.text.__*) - *(.rodata) } + .text.lock : { *(.text.lock) } /* out-of-line lock text */ + + _etext = . ; /* End of text section */ + __etext = .; + + .rodata : { *(.rodata) *(.rodata.__*) } + .kstrtab : { *(.kstrtab) } . = ALIGN(4); /* Exception table */ __start___ex_table = .; __ex_table : { *(__ex_table) } __stop___ex_table = .; - _etext = . ; /* End of text section */ - __etext = .; + __start___ksymtab = .; /* Kernel symbol table */ + __ksymtab : { *(__ksymtab) } + __stop___ksymtab = .; . = ALIGN (4); - ___data_rom_start = . ; ___data_start = . ; __Sdata = . ; .data : { /* Data */ @@ -45,19 +54,26 @@ .data.init_task : { *(.data.init_task) } . = ALIGN(8192); /* Init code and data */ - ___init_begin = .; + __init_begin = .; .text.init : { *(.text.init) } .data.init : { *(.data.init) } . = ALIGN(16); - ___setup_start = .; + __setup_start = .; .setup.init : { *(.setup.init) } - ___setup_end = .; - ___initcall_start = .; - .initcall.init : { *(.initcall.init) } - ___initcall_end = .; + __setup_end = .; + .initcall.init : { + __initcall_start = .; + *(.initcall.init); + __initcall_end = .; + + /* We fill to the next page, so we can discard all init + pages without needing to consider what payload might be + appended to the kernel image. */ + FILL (0); + . = ALIGN (8192); + } __vmlinux_end = .; /* last address of the physical file */ - . = ALIGN(8192); - ___init_end = .; + __init_end = .; __data_end = . ; /* Move to _edata ? */ __bss_start = .; /* BSS */ @@ -77,5 +93,5 @@ *(.exitcall.exit) } - _dram_end = 0x60000000 + @ETRAX_DRAM_SIZE_M@*1024*1024; + dram_end = dram_start + @CONFIG_ETRAX_DRAM_SIZE_M@*1024*1024; } Index: defconfig =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/cris/defconfig,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- defconfig 25 Feb 2001 23:15:23 -0000 1.1.1.1 +++ defconfig 9 Apr 2002 17:03:15 -0000 1.2 @@ -2,6 +2,8 @@ # Automatically generated make config: don't edit # CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set # # Code maturity level options @@ -13,49 +15,177 @@ # CONFIG_NET=y CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_JAVA is not set -# CONFIG_KGDB is not set +# CONFIG_ETRAX_KGDB is not set # CONFIG_ETRAX_WATCHDOG is not set -CONFIG_USE_SERIAL_CONSOLE=y -# CONFIG_KERNEL_IFCONFIG is not set # # Hardware setup # CONFIG_ETRAX100LX=y +# CONFIG_ETRAX100LX_V2 is not set # CONFIG_SVINTO_SIM is not set CONFIG_CRIS_LOW_MAP=y -ETRAX_DRAM_BASE=40000000 -ETRAX_DRAM_SIZE=8 +CONFIG_ETRAX_DRAM_VIRTUAL_BASE=60000000 +CONFIG_ETRAX_DRAM_SIZE=8 +CONFIG_ETRAX_FLASH_BUSWIDTH=2 +CONFIG_ETRAX_ROOT_DEVICE="/dev/mtdblock3" CONFIG_ETRAX_PA_LEDS=y # CONFIG_ETRAX_PB_LEDS is not set -# CONFIG_ETRAX_90000000_LEDS is not set +# CONFIG_ETRAX_CSP0_LEDS is not set # CONFIG_ETRAX_NO_LEDS is not set CONFIG_ETRAX_LED1G=2 CONFIG_ETRAX_LED1R=2 CONFIG_ETRAX_LED2G=2 CONFIG_ETRAX_LED2R=2 -CONFIG_DEBUG_PORT0=y -# CONFIG_DEBUG_PORT1 is not set -# CONFIG_DEBUG_PORT2 is not set -# CONFIG_DEBUG_PORT3 is not set -DEF_R_WAITSTATES=95a6 -DEF_R_BUS_CONFIG=104 -DEF_R_DRAM_CONFIG=1a200040 -DEF_R_DRAM_TIMING=5611 -DEF_R_PORT_PA_DIR=1d -DEF_R_PORT_PA_DATA=f0 -DEF_R_PORT_PB_CONFIG=00 -DEF_R_PORT_PB_DIR=1e -DEF_R_PORT_PB_DATA=f3 +CONFIG_ETRAX_LED3R=2 +CONFIG_ETRAX_LED3G=2 +CONFIG_ETRAX_LED4R=2 +CONFIG_ETRAX_LED4G=2 +CONFIG_ETRAX_LED5R=2 +CONFIG_ETRAX_LED5G=2 +CONFIG_ETRAX_LED6R=2 +CONFIG_ETRAX_LED6G=2 +CONFIG_ETRAX_LED7R=2 +CONFIG_ETRAX_LED7G=2 +CONFIG_ETRAX_LED8Y=2 +CONFIG_ETRAX_LED9Y=2 +CONFIG_ETRAX_LED10Y=2 +CONFIG_ETRAX_LED11Y=2 +CONFIG_ETRAX_LED12R=2 +CONFIG_ETRAX_DEBUG_PORT0=y +# CONFIG_ETRAX_DEBUG_PORT1 is not set +# CONFIG_ETRAX_DEBUG_PORT2 is not set +# CONFIG_ETRAX_DEBUG_PORT3 is not set +CONFIG_ETRAX_RESCUE_SER0=y +# CONFIG_ETRAX_RESCUE_SER1 is not set +# CONFIG_ETRAX_RESCUE_SER2 is not set +# CONFIG_ETRAX_RESCUE_SER3 is not set +CONFIG_ETRAX_DEF_R_WAITSTATES=95a6 +CONFIG_ETRAX_DEF_R_BUS_CONFIG=104 +# CONFIG_ETRAX_SDRAM is not set +CONFIG_ETRAX_DEF_R_DRAM_CONFIG=1a200040 +CONFIG_ETRAX_DEF_R_DRAM_TIMING=5611 +CONFIG_ETRAX_DEF_R_PORT_PA_DIR=1d +CONFIG_ETRAX_DEF_R_PORT_PA_DATA=f0 +CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=00 +CONFIG_ETRAX_DEF_R_PORT_PB_DIR=1e +CONFIG_ETRAX_DEF_R_PORT_PB_DATA=f3 +# CONFIG_ETRAX_SOFT_SHUTDOWN is not set # -# Drivers for Etrax built-in interfaces +# Drivers for ETRAX 100LX built-in interfaces # CONFIG_ETRAX_ETHERNET=y CONFIG_NET_ETHERNET=y +# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set +CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y +# CONFIG_ETRAX_ETHERNET_LPSLAVE is not set CONFIG_ETRAX_SERIAL=y +CONFIG_ETRAX_SERIAL_PORT0=y +# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set +CONFIG_ETRAX_SERIAL_PORT1=y +# CONFIG_ETRAX_SER1_DTR_RI_DSR_CD_ON_PB is not set +# CONFIG_ETRAX_SERIAL_PORT2 is not set +# CONFIG_ETRAX_SERIAL_PORT3 is not set +# CONFIG_ETRAX_RS485 is not set +# CONFIG_ETRAX_SYNCHRONOUS_SERIAL is not set +# CONFIG_ETRAX_IDE is not set +CONFIG_ETRAX_AXISFLASHMAP=y +CONFIG_ETRAX_PTABLE_SECTOR=65536 +CONFIG_MTD=y +CONFIG_MTD_CFI=y +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_AMDSTD=y +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +CONFIG_ETRAX_I2C=y +CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C=y +# CONFIG_ETRAX_I2C_EEPROM is not set +CONFIG_ETRAX_GPIO=y +CONFIG_ETRAX_PA_BUTTON_BITMASK=02 +CONFIG_ETRAX_PA_CHANGEABLE_DIR=00 +CONFIG_ETRAX_PA_CHANGEABLE_BITS=FF +CONFIG_ETRAX_PB_CHANGEABLE_DIR=00 +CONFIG_ETRAX_PB_CHANGEABLE_BITS=FF +# CONFIG_ETRAX_USB_HOST is not set +# CONFIG_USB is not set +# CONFIG_ETRAX_DS1302 is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC1000 is not set +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOCPROBE is not set + +# +# RAM/ROM Device Drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_MTDRAM is not set + +# +# Linearly Mapped Flash Device Drivers +# +CONFIG_MTD_CFI=y +# CONFIG_MTD_CFI_GEOMETRY is not set +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_AMDSTD=y +# CONFIG_MTD_SHARP is not set +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_NORA is not set +# CONFIG_MTD_PNC2000 is not set +# CONFIG_MTD_RPXLITE is not set +# CONFIG_MTD_SC520CDP is not set +# CONFIG_MTD_SBC_MEDIAGX is not set +# CONFIG_MTD_ELAN_104NC is not set +# CONFIG_MTD_SA1100 is not set +# CONFIG_MTD_DC21285 is not set +# CONFIG_MTD_CSTM_CFI_JEDEC is not set +# CONFIG_MTD_JEDEC is not set +# CONFIG_MTD_MIXMEM is not set +# CONFIG_MTD_OCTAGON is not set +# CONFIG_MTD_VMAX is not set + +# +# NAND Flash Device Drivers +# +# CONFIG_MTD_NAND is not set +# CONFIG_MTD_NAND_SPIA is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set # # Block devices @@ -90,10 +220,6 @@ # CONFIG_IPV6 is not set # CONFIG_KHTTPD is not set # CONFIG_ATM is not set - -# -# -# # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_DECNET is not set @@ -101,6 +227,7 @@ # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set @@ -112,11 +239,61 @@ # CONFIG_NET_SCHED is not set # +# Telephony Support +# +# CONFIG_PHONE is not set +# CONFIG_PHONE_IXJ is not set + +# +# ATA/IDE/MFM/RLL support +# +# CONFIG_IDE is not set + +# +# IDE, ATA and ATAPI Block devices +# +# CONFIG_BLK_DEV_IDE is not set +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_IDEDISK is not set +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES is not set + +# # SCSI support # # CONFIG_SCSI is not set # +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# # Network device support # CONFIG_NETDEVICES=y @@ -177,6 +354,16 @@ # CONFIG_WAN is not set # +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# # ISDN subsystem # # CONFIG_ISDN is not set @@ -187,6 +374,60 @@ # CONFIG_CD_NO_IDESCSI is not set # +# Input core support +# +# CONFIG_INPUT is not set + +# +# Character devices +# +# CONFIG_VT is not set +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_UNIX98_PTYS is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_JOYSTICK is not set +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# # File systems # # CONFIG_QUOTA is not set @@ -259,59 +500,14 @@ # CONFIG_NLS is not set # -# Character devices -# -# CONFIG_VT is not set -# CONFIG_SERIAL is not set -# CONFIG_SERIAL_EXTENDED is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_UNIX98_PTYS is not set -# CONFIG_PRINTER is not set -# CONFIG_PPDEV is not set - -# -# I2C support -# -# CONFIG_I2C is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set -# CONFIG_MOUSE is not set - -# -# Joysticks -# -# CONFIG_JOYSTICK is not set - -# -# Input core support is needed for joysticks -# -# CONFIG_QIC02_TAPE is not set - -# -# Watchdog Cards -# -# CONFIG_WATCHDOG is not set -# CONFIG_INTEL_RNG is not set -# CONFIG_NVRAM is not set -# CONFIG_RTC is not set -# CONFIG_DTLK is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set - -# -# Ftape, the floppy tape device driver +# Sound # -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set -# CONFIG_DRM is not set +# CONFIG_SOUND is not set # -# Sound +# USB support # -# CONFIG_SOUND is not set +# CONFIG_USB is not set # # Kernel hacking |