From 529c593ece216e4aaffd36bd940cb94f1fa63129 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 23 Feb 2000 00:40:54 +0000 Subject: Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c driver due to the Origin A64 hacks. --- arch/arm/def-configs/a5k | 10 ++++ arch/arm/def-configs/footbridge | 12 +++++ arch/arm/def-configs/rpc | 11 ++++ arch/arm/defconfig | 11 ++++ arch/arm/kernel/Makefile | 6 +-- arch/arm/kernel/bios32.c | 37 +++++++++---- arch/arm/kernel/time-acorn.c | 71 ++++++++++++++++++++++++ arch/arm/kernel/time.c | 116 ++++++++++++++++++++++++++++++++++------ arch/arm/kernel/traps.c | 9 ++-- arch/arm/lib/io.c | 7 +-- arch/arm/mm/init.c | 5 -- arch/arm/mm/ioremap.c | 2 +- arch/arm/mm/mm-armv.c | 13 +++-- 13 files changed, 262 insertions(+), 48 deletions(-) create mode 100644 arch/arm/kernel/time-acorn.c (limited to 'arch/arm') diff --git a/arch/arm/def-configs/a5k b/arch/arm/def-configs/a5k index b5fd4b315..21a6488eb 100644 --- a/arch/arm/def-configs/a5k +++ b/arch/arm/def-configs/a5k @@ -167,6 +167,11 @@ CONFIG_MOUSE=y # CONFIG_FTAPE is not set # CONFIG_DRM is not set # CONFIG_DRM_TDFX is not set + +# +# PCMCIA character device support +# +# CONFIG_PCMCIA_SERIAL_CS is not set # CONFIG_AGP is not set # @@ -323,6 +328,11 @@ CONFIG_ARM_ETHER3=y # # CONFIG_WAN is not set +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + # # SCSI support # diff --git a/arch/arm/def-configs/footbridge b/arch/arm/def-configs/footbridge index d68d0b358..e43a8d2a9 100644 --- a/arch/arm/def-configs/footbridge +++ b/arch/arm/def-configs/footbridge @@ -54,6 +54,7 @@ CONFIG_BINFMT_ELF=y CONFIG_PARPORT=y CONFIG_PARPORT_PC=y CONFIG_PARPORT_PC_FIFO=y +# CONFIG_PARPORT_PC_PCMCIA is not set # CONFIG_PARPORT_ARC is not set # CONFIG_PARPORT_AMIGA is not set # CONFIG_PARPORT_MFC3 is not set @@ -263,6 +264,12 @@ CONFIG_VIDEO_CYBERPRO=m # CONFIG_DRM is not set # CONFIG_DRM_TDFX is not set +# +# PCMCIA character device support +# +# CONFIG_PCMCIA_SERIAL_CS is not set +# CONFIG_AGP is not set + # # Support for USB # @@ -496,6 +503,11 @@ CONFIG_SLIP_MODE_SLIP6=y # # CONFIG_WAN is not set +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + # # SCSI support # diff --git a/arch/arm/def-configs/rpc b/arch/arm/def-configs/rpc index e801bf641..a22e1d992 100644 --- a/arch/arm/def-configs/rpc +++ b/arch/arm/def-configs/rpc @@ -50,6 +50,7 @@ CONFIG_BINFMT_ELF=y CONFIG_PARPORT=y CONFIG_PARPORT_PC=y # CONFIG_PARPORT_PC_FIFO is not set +# CONFIG_PARPORT_PC_PCMCIA is not set # CONFIG_PARPORT_ARC is not set # CONFIG_PARPORT_AMIGA is not set # CONFIG_PARPORT_MFC3 is not set @@ -176,6 +177,11 @@ CONFIG_MOUSE=y # CONFIG_FTAPE is not set # CONFIG_DRM is not set # CONFIG_DRM_TDFX is not set + +# +# PCMCIA character device support +# +# CONFIG_PCMCIA_SERIAL_CS is not set # CONFIG_AGP is not set CONFIG_RPCMOUSE=y @@ -348,6 +354,11 @@ CONFIG_PPP=m # # CONFIG_WAN is not set +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + # # SCSI support # diff --git a/arch/arm/defconfig b/arch/arm/defconfig index 472c637c3..e43a8d2a9 100644 --- a/arch/arm/defconfig +++ b/arch/arm/defconfig @@ -54,6 +54,7 @@ CONFIG_BINFMT_ELF=y CONFIG_PARPORT=y CONFIG_PARPORT_PC=y CONFIG_PARPORT_PC_FIFO=y +# CONFIG_PARPORT_PC_PCMCIA is not set # CONFIG_PARPORT_ARC is not set # CONFIG_PARPORT_AMIGA is not set # CONFIG_PARPORT_MFC3 is not set @@ -262,6 +263,11 @@ CONFIG_VIDEO_CYBERPRO=m # CONFIG_FTAPE is not set # CONFIG_DRM is not set # CONFIG_DRM_TDFX is not set + +# +# PCMCIA character device support +# +# CONFIG_PCMCIA_SERIAL_CS is not set # CONFIG_AGP is not set # @@ -497,6 +503,11 @@ CONFIG_SLIP_MODE_SLIP6=y # # CONFIG_WAN is not set +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + # # SCSI support # diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 3b79f080b..3920edade 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -16,9 +16,9 @@ ifeq ($(CONFIG_ISA_DMA),y) ISA_DMA_OBJS += dma-isa.o endif -O_OBJS_arc = dma-arc.o iic.o fiq.o oldlatches.o -O_OBJS_a5k = dma-a5k.o iic.o fiq.o -O_OBJS_rpc = dma-rpc.o iic.o fiq.o +O_OBJS_arc = dma-arc.o iic.o fiq.o time-acorn.o oldlatches.o +O_OBJS_a5k = dma-a5k.o iic.o fiq.o time-acorn.o +O_OBJS_rpc = dma-rpc.o iic.o fiq.o time-acorn.o O_OBJS_ebsa110 = dma-dummy.o O_OBJS_footbridge = dma-footbridge.o $(ISA_DMA_OBJS) isa.o O_OBJS_nexuspci = dma-dummy.o diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index d055ae1fb..7a1b57c22 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -381,7 +381,7 @@ void __init pcibios_init(void) * Assign any unassigned resources. Note that we really ought to * have min/max stuff here - max mem address is 0x0fffffff */ - pci_assign_unassigned_resources(hw_pci->io_start, hw_pci->mem_start); + pci_assign_unassigned_resources(); pci_fixup_irqs(hw_pci->swizzle, hw_pci->map_irq); pci_set_bus_ranges(); @@ -404,17 +404,34 @@ char * __init pcibios_setup(char *str) return str; } -/* - * Assign new address to PCI resource. We hope our resource information - * is complete. - * - * Expects start=0, end=size-1, flags=resource type. - */ -int pci_assign_resource(struct pci_dev *dev, int i) +void pcibios_align_resource(void *data, struct resource *res, unsigned long size) { - return 0; } -void pcibios_align_resource(void *data, struct resource *res, unsigned long size) +int pcibios_enable_device(struct pci_dev *dev) { + u16 cmd, old_cmd; + int idx; + struct resource *r; + + pci_read_config_word(dev, PCI_COMMAND, &cmd); + old_cmd = cmd; + for (idx = 0; idx < 6; idx++) { + r = dev->resource + idx; + if (!r->start && r->end) { + printk(KERN_ERR "PCI: Device %s not available because" + " of resource collisions\n", dev->slot_name); + return -EINVAL; + } + if (r->flags & IORESOURCE_IO) + cmd |= PCI_COMMAND_IO; + if (r->flags & IORESOURCE_MEM) + cmd |= PCI_COMMAND_MEMORY; + } + if (cmd != old_cmd) { + printk("PCI: enabling device %s (%04x -> %04x)\n", + dev->slot_name, old_cmd, cmd); + pci_write_config_word(dev, PCI_COMMAND, cmd); + } + return 0; } diff --git a/arch/arm/kernel/time-acorn.c b/arch/arm/kernel/time-acorn.c new file mode 100644 index 000000000..8a7d964fc --- /dev/null +++ b/arch/arm/kernel/time-acorn.c @@ -0,0 +1,71 @@ +/* + * linux/arch/arm/kernel/time-acorn.c + * + * Copyright (c) 1996-2000 Russell King. + * + * Changelog: + * 24-Sep-1996 RMK Created + * 10-Oct-1996 RMK Brought up to date with arch-sa110eval + * 04-Dec-1997 RMK Updated for new arch/arm/time.c + */ +#include +#include +#include + +#include +#include +#include +#include + +extern unsigned long (*gettimeoffset)(void); + +static unsigned long ioctime_gettimeoffset(void) +{ + unsigned int count1, count2, status1, status2; + unsigned long offset = 0; + + status1 = inb(IOC_IRQREQA); + barrier (); + outb (0, IOC_T0LATCH); + barrier (); + count1 = inb(IOC_T0CNTL) | (inb(IOC_T0CNTH) << 8); + barrier (); + status2 = inb(IOC_IRQREQA); + barrier (); + outb (0, IOC_T0LATCH); + barrier (); + count2 = inb(IOC_T0CNTL) | (inb(IOC_T0CNTH) << 8); + + if (count2 < count1) { + /* + * This means that we haven't just had an interrupt + * while reading into status2. + */ + if (status2 & (1 << 5)) + offset = tick; + count1 = count2; + } else if (count2 > count1) { + /* + * We have just had another interrupt while reading + * status2. + */ + offset += tick; + count1 = count2; + } + + count1 = LATCH - count1; + /* + * count1 = number of clock ticks since last interrupt + */ + offset += count1 * tick / LATCH; + return offset; +} + +void __init ioctime_init(void) +{ + outb(LATCH & 255, IOC_T0LTCHL); + outb(LATCH >> 8, IOC_T0LTCHH); + outb(0, IOC_T0GO); + + gettimeoffset = ioctime_gettimeoffset; +} diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 67c2597e6..0fcad67c0 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -12,15 +12,12 @@ * 1998-12-20 Updated NTP code according to technical memorandum Jan '96 * "A Kernel Model for Precision Timekeeping" by Dave Mills */ +#include #include #include #include -#include -#include -#include #include #include -#include #include #include @@ -32,6 +29,7 @@ #include extern int setup_arm_irq(int, struct irqaction *); +extern void setup_timer(void); extern volatile unsigned long lost_ticks; /* change this if you have some constant time drift */ @@ -45,6 +43,26 @@ extern volatile unsigned long lost_ticks; #define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) #endif +static int dummy_set_rtc(void) +{ + return 0; +} + +/* + * hook for setting the RTC's idea of the current time. + */ +int (*set_rtc)(void) = dummy_set_rtc; + +static unsigned long dummy_gettimeoffset(void) +{ + return 0; +} + +/* + * hook for getting the time offset + */ +unsigned long (*gettimeoffset)(void) = dummy_gettimeoffset; + /* Converts Gregorian date to seconds since 1970-01-01 00:00:00. * Assumes input in normal date format, i.e. 1980-12-31 23:59:59 * => year=1980, mon=12, day=31, hour=23, min=59, sec=59. @@ -60,9 +78,9 @@ extern volatile unsigned long lost_ticks; * machines were long is 32-bit! (However, as time_t is signed, we * will already get problems at other places on 2038-01-19 03:14:08) */ -unsigned long mktime(unsigned int year, unsigned int mon, - unsigned int day, unsigned int hour, - unsigned int min, unsigned int sec) +unsigned long +mktime(unsigned int year, unsigned int mon, unsigned int day, + unsigned int hour, unsigned int min, unsigned int sec) { if (0 >= (int) (mon -= 2)) { /* 1..12 -> 11,12,1..10 */ mon += 12; /* Puts Feb last since it has leap day */ @@ -77,11 +95,14 @@ unsigned long mktime(unsigned int year, unsigned int mon, } /* - * Handle profile stuff... + * Handle kernel profile stuff... */ -static void do_profile(unsigned long pc) +static inline void do_profile(struct pt_regs *regs) { - if (prof_buffer && current->pid) { + if (!user_mode(regs) && + prof_buffer && + current->pid) { + unsigned long pc = instruction_pointer(regs); extern int _stext; pc -= (unsigned long)&_stext; @@ -95,12 +116,61 @@ static void do_profile(unsigned long pc) } } -#include +static long next_rtc_update; + +/* + * If we have an externally synchronized linux clock, then update + * CMOS clock accordingly every ~11 minutes. set_rtc() has to be + * called as close as possible to 500 ms before the new second + * starts. + */ +static inline void do_set_rtc(void) +{ + if (time_status & STA_UNSYNC || set_rtc == NULL) + return; + + if (next_rtc_update && + time_before(xtime.tv_sec, next_rtc_update)) + return; + + if (xtime.tv_usec < 50000 - (tick >> 1) && + xtime.tv_usec >= 50000 + (tick >> 1)) + return; + + if (set_rtc()) + /* + * rtc update failed. Try again in 60s + */ + next_rtc_update = xtime.tv_sec + 60; + else + next_rtc_update = xtime.tv_sec + 660; +} + +#ifdef CONFIG_LEDS -static unsigned long do_gettimeoffset(void) +#include + +static void do_leds(void) { - return gettimeoffset (); + static unsigned int count = 50; + static int last_pid; + + if (current->pid != last_pid) { + last_pid = current->pid; + if (last_pid) + leds_event(led_idle_end); + else + leds_event(led_idle_start); + } + + if (--count == 0) { + count = 50; + leds_event(led_timer); + } } +#else +#define do_leds() +#endif void do_gettimeofday(struct timeval *tv) { @@ -108,7 +178,7 @@ void do_gettimeofday(struct timeval *tv) save_flags_cli (flags); *tv = xtime; - tv->tv_usec += do_gettimeoffset(); + tv->tv_usec += gettimeoffset(); /* * xtime is atomically updated in timer_bh. lost_ticks is @@ -134,7 +204,7 @@ void do_settimeofday(struct timeval *tv) * Discover what correction gettimeofday * would have done, and then undo it! */ - tv->tv_usec -= do_gettimeoffset(); + tv->tv_usec -= gettimeoffset(); if (tv->tv_usec < 0) { tv->tv_usec += 1000000; @@ -149,9 +219,25 @@ void do_settimeofday(struct timeval *tv) sti(); } +static struct irqaction timer_irq = { + NULL, 0, 0, "timer", NULL, NULL +}; + +/* + * Include architecture specific code + */ +#include + +/* + * This must cause the timer to start ticking. + * It doesn't have to set the current time though + * from an RTC - it can be done later once we have + * some buses initialised. + */ void __init time_init(void) { xtime.tv_usec = 0; + xtime.tv_sec = 0; setup_timer(); } diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index ac15651d3..18d9931ee 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -370,7 +370,7 @@ asmlinkage void arm_invalidptr(const char *function, int size) asmlinkage void baddataabort(int code, unsigned long instr, struct pt_regs *regs) { - unsigned long phys, addr = instruction_pointer(regs); + unsigned long addr = instruction_pointer(regs); #ifdef CONFIG_DEBUG_ERRORS dump_instr(addr, 1); @@ -383,11 +383,8 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs) pmd_t *pmd; pmd = pmd_offset (pgd, addr); printk (", *pmd = %08lx", pmd_val (*pmd)); - if (!pmd_none (*pmd)) { - unsigned long ptr = pte_page(*pte_offset(pmd, addr)); - printk (", *pte = %08lx", pte_val (*pte_offset (pmd, addr))); - phys = ptr + (addr & 0x7fff); - } + if (!pmd_none (*pmd)) + printk (", *pte = %08lx", pte_val(*pte_offset (pmd, addr))); } printk ("\n"); } diff --git a/arch/arm/lib/io.c b/arch/arm/lib/io.c index a7720eca1..198633edd 100644 --- a/arch/arm/lib/io.c +++ b/arch/arm/lib/io.c @@ -1,4 +1,5 @@ #include +#include #include @@ -6,7 +7,7 @@ * Copy data from IO memory space to "real" memory space. * This needs to be optimized. */ -void _memcpy_fromio(void * to, unsigned long from, unsigned long count) +void _memcpy_fromio(void * to, unsigned long from, size_t count) { while (count) { count--; @@ -20,7 +21,7 @@ void _memcpy_fromio(void * to, unsigned long from, unsigned long count) * Copy data from "real" memory space to IO memory space. * This needs to be optimized. */ -void _memcpy_toio(unsigned long to, const void * from, unsigned long count) +void _memcpy_toio(unsigned long to, const void * from, size_t count) { while (count) { count--; @@ -34,7 +35,7 @@ void _memcpy_toio(unsigned long to, const void * from, unsigned long count) * "memset" on IO memory space. * This needs to be optimized. */ -void _memset_io(unsigned long dst, int c, unsigned long count) +void _memset_io(unsigned long dst, int c, size_t count) { while (count) { count--; diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index bc4cf1ed1..db3ac5a4d 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -35,8 +35,6 @@ static unsigned long totalram_pages; pgd_t swapper_pg_dir[PTRS_PER_PGD]; -extern void show_net_buffers(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 @@ -157,9 +155,6 @@ void show_mem(void) printk("%ld page tables cached\n", pgtable_cache_size); #endif show_buffers(); -#ifdef CONFIG_NET - show_net_buffers(); -#endif } /* diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index fb3007f8a..d59b4e16c 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -115,7 +115,7 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr, * 'flags' are the extra L_PTE_ flags that you want to specify for this * mapping. See include/asm-arm/proc-armv/pgtable.h for more information. */ -void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) +void * __ioremap(unsigned long phys_addr, size_t size, unsigned long flags) { void * addr; struct vm_struct * area; diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index 76d101507..92007d975 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c @@ -34,6 +34,7 @@ static int __init nocache_setup(char *__unused) { cr_alignment &= ~4; cr_no_alignment &= ~4; + flush_cache_all(); set_cr(cr_alignment); return 1; } @@ -42,6 +43,7 @@ static int __init nowrite_setup(char *__unused) { cr_alignment &= ~(8|4); cr_no_alignment &= ~(8|4); + flush_cache_all(); set_cr(cr_alignment); return 1; } @@ -284,7 +286,7 @@ static void __init create_mapping(struct map_desc *md) void __init pagetable_init(void) { - struct map_desc *init_maps, *p; + struct map_desc *init_maps, *p, *q; unsigned long address = 0; int i; @@ -358,17 +360,18 @@ void __init pagetable_init(void) * pgdir entries that are not in the description. */ i = 0; + q = init_maps; do { - if (address < init_maps->virtual || init_maps == p) { + if (address < q->virtual || q == p) { clear_mapping(address); address += PGDIR_SIZE; } else { - create_mapping(init_maps); + create_mapping(q); - address = init_maps->virtual + init_maps->length; + address = q->virtual + q->length; address = (address + PGDIR_SIZE - 1) & PGDIR_MASK; - init_maps ++; + q ++; } } while (address != 0); -- cgit v1.2.3