Update of /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-footbridge
In directory usw-pr-cvs1:/tmp/cvs-serv24336/arm/mach-footbridge
Modified Files:
Makefile arch.c cats-pci.c ebsa285-pci.c netwinder-pci.c
personal-pci.c
Added Files:
irq.c mm.c
Log Message:
synch 2.4.15 commit 32
--- NEW FILE ---
/*
* linux/arch/arm/mach-footbridge/irq.c
*
* Copyright (C) 1996-2000 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Changelog:
* 22-Aug-1998 RMK Restructured IRQ routines
* 03-Sep-1998 PJB Merged CATS support
* 20-Jan-1998 RMK Started merge of EBSA286, CATS and NetWinder
* 26-Jan-1999 PJB Don't use IACK on CATS
* 16-Mar-1999 RMK Added autodetect of ISA PICs
*/
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <asm/mach/irq.h>
#include <asm/hardware.h>
#include <asm/hardware/dec21285.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/mach-types.h>
/*
* Footbridge IRQ translation table
* Converts from our IRQ numbers into FootBridge masks
*/
static const int fb_irq_mask[] = {
IRQ_MASK_UART_RX, /* 0 */
IRQ_MASK_UART_TX, /* 1 */
IRQ_MASK_TIMER1, /* 2 */
IRQ_MASK_TIMER2, /* 3 */
IRQ_MASK_TIMER3, /* 4 */
IRQ_MASK_IN0, /* 5 */
IRQ_MASK_IN1, /* 6 */
IRQ_MASK_IN2, /* 7 */
IRQ_MASK_IN3, /* 8 */
IRQ_MASK_DOORBELLHOST, /* 9 */
IRQ_MASK_DMA1, /* 10 */
IRQ_MASK_DMA2, /* 11 */
IRQ_MASK_PCI, /* 12 */
IRQ_MASK_SDRAMPARITY, /* 13 */
IRQ_MASK_I2OINPOST, /* 14 */
IRQ_MASK_PCI_ABORT, /* 15 */
IRQ_MASK_PCI_SERR, /* 16 */
IRQ_MASK_DISCARD_TIMER, /* 17 */
IRQ_MASK_PCI_DPERR, /* 18 */
IRQ_MASK_PCI_PERR, /* 19 */
};
static void fb_mask_irq(unsigned int irq)
{
*CSR_IRQ_DISABLE = fb_irq_mask[_DC21285_INR(irq)];
}
static void fb_unmask_irq(unsigned int irq)
{
*CSR_IRQ_ENABLE = fb_irq_mask[_DC21285_INR(irq)];
}
static void __init __fb_init_irq(void)
{
int irq;
/*
* setup DC21285 IRQs
*/
*CSR_IRQ_DISABLE = -1;
*CSR_FIQ_DISABLE = -1;
for (irq = _DC21285_IRQ(0); irq < _DC21285_IRQ(20); irq++) {
irq_desc[irq].valid = 1;
irq_desc[irq].probe_ok = 1;
irq_desc[irq].mask_ack = fb_mask_irq;
irq_desc[irq].mask = fb_mask_irq;
irq_desc[irq].unmask = fb_unmask_irq;
}
}
extern int isa_irq;
static void isa_mask_pic_lo_irq(unsigned int irq)
{
unsigned int mask = 1 << (irq & 7);
outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO);
}
static void isa_mask_ack_pic_lo_irq(unsigned int irq)
{
unsigned int mask = 1 << (irq & 7);
outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO);
outb(0x20, PIC_LO);
}
static void isa_unmask_pic_lo_irq(unsigned int irq)
{
unsigned int mask = 1 << (irq & 7);
outb(inb(PIC_MASK_LO) & ~mask, PIC_MASK_LO);
}
static void isa_mask_pic_hi_irq(unsigned int irq)
{
unsigned int mask = 1 << (irq & 7);
outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI);
}
static void isa_mask_ack_pic_hi_irq(unsigned int irq)
{
unsigned int mask = 1 << (irq & 7);
outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI);
outb(0x62, PIC_LO);
outb(0x20, PIC_HI);
}
static void isa_unmask_pic_hi_irq(unsigned int irq)
{
unsigned int mask = 1 << (irq & 7);
outb(inb(PIC_MASK_HI) & ~mask, PIC_MASK_HI);
}
static void no_action(int irq, void *dev_id, struct pt_regs *regs)
{
}
static struct irqaction irq_cascade = { handler: no_action, name: "cascade", };
static struct resource pic1_resource = { "pic1", 0x20, 0x3f };
static struct resource pic2_resource = { "pic2", 0xa0, 0xbf };
static void __init isa_init_irq(int irq)
{
/*
* Setup, and then probe for an ISA PIC
* If the PIC is not there, then we
* ignore the PIC.
*/
outb(0x11, PIC_LO);
outb(_ISA_IRQ(0), PIC_MASK_LO); /* IRQ number */
outb(0x04, PIC_MASK_LO); /* Slave on Ch2 */
outb(0x01, PIC_MASK_LO); /* x86 */
outb(0xf5, PIC_MASK_LO); /* pattern: 11110101 */
outb(0x11, PIC_HI);
outb(_ISA_IRQ(8), PIC_MASK_HI); /* IRQ number */
outb(0x02, PIC_MASK_HI); /* Slave on Ch1 */
outb(0x01, PIC_MASK_HI); /* x86 */
outb(0xfa, PIC_MASK_HI); /* pattern: 11111010 */
outb(0x0b, PIC_LO);
outb(0x0b, PIC_HI);
if (inb(PIC_MASK_LO) == 0xf5 && inb(PIC_MASK_HI) == 0xfa) {
outb(0xff, PIC_MASK_LO);/* mask all IRQs */
outb(0xff, PIC_MASK_HI);/* mask all IRQs */
isa_irq = irq;
} else
isa_irq = -1;
if (isa_irq != -1) {
for (irq = _ISA_IRQ(0); irq < _ISA_IRQ(8); irq++) {
irq_desc[irq].valid = 1;
irq_desc[irq].probe_ok = 1;
irq_desc[irq].mask_ack = isa_mask_ack_pic_lo_irq;
irq_desc[irq].mask = isa_mask_pic_lo_irq;
irq_desc[irq].unmask = isa_unmask_pic_lo_irq;
}
for (irq = _ISA_IRQ(8); irq < _ISA_IRQ(16); irq++) {
irq_desc[irq].valid = 1;
irq_desc[irq].probe_ok = 1;
irq_desc[irq].mask_ack = isa_mask_ack_pic_hi_irq;
irq_desc[irq].mask = isa_mask_pic_hi_irq;
irq_desc[irq].unmask = isa_unmask_pic_hi_irq;
}
request_resource(&ioport_resource, &pic1_resource);
request_resource(&ioport_resource, &pic2_resource);
setup_arm_irq(IRQ_ISA_CASCADE, &irq_cascade);
setup_arm_irq(isa_irq, &irq_cascade);
/*
* On the NetWinder, don't automatically
* enable ISA IRQ11 when it is requested.
* There appears to be a missing pull-up
* resistor on this line.
*/
if (machine_is_netwinder())
irq_desc[_ISA_IRQ(11)].noautoenable = 1;
}
}
void __init footbridge_init_irq(void)
{
__fb_init_irq();
if (!footbridge_cfn_mode())
return;
if (machine_is_ebsa285())
/* The following is dependent on which slot
* you plug the Southbridge card into. We
* currently assume that you plug it into
* the right-hand most slot.
*/
isa_init_irq(IRQ_PCI);
if (machine_is_cats())
isa_init_irq(IRQ_IN2);
if (machine_is_netwinder())
isa_init_irq(IRQ_IN3);
}
--- NEW FILE ---
/*
* linux/arch/arm/mach-footbridge/mm.c
*
* Copyright (C) 1998-2000 Russell King, Dave Gilbert.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Extra MM routines for the EBSA285 architecture
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/io.h>
#include <asm/hardware/dec21285.h>
#include <asm/mach-types.h>
#include <asm/mach/map.h>
/*
* Common mapping for all systems. Note that the outbound write flush is
* commented out since there is a "No Fix" problem with it. Not mapping
* it means that we have extra bullet protection on our feet.
*/
static struct map_desc fb_common_io_desc[] __initdata = {
{ ARMCSR_BASE, DC21285_ARMCSR_BASE, ARMCSR_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
{ XBUS_BASE, 0x40000000, XBUS_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
LAST_DESC
};
/*
* The mapping when the footbridge is in host mode. We don't map any of
* this when we are in add-in mode.
*/
static struct map_desc ebsa285_host_io_desc[] __initdata = {
#if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_FOOTBRIDGE_HOST)
{ PCIMEM_BASE, DC21285_PCI_MEM, PCIMEM_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
{ PCICFG0_BASE, DC21285_PCI_TYPE_0_CONFIG, PCICFG0_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
{ PCICFG1_BASE, DC21285_PCI_TYPE_1_CONFIG, PCICFG1_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
{ PCIIACK_BASE, DC21285_PCI_IACK, PCIIACK_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
{ PCIO_BASE, DC21285_PCI_IO, PCIO_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
#endif
LAST_DESC
};
/*
* The CO-ebsa285 mapping.
*/
static struct map_desc co285_io_desc[] __initdata = {
#ifdef CONFIG_ARCH_CO285
{ PCIO_BASE, DC21285_PCI_IO, PCIO_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
{ PCIMEM_BASE, DC21285_PCI_MEM, PCIMEM_SIZE, DOMAIN_IO, 0, 1, 0, 0 },
#endif
LAST_DESC
};
void __init footbridge_map_io(void)
{
struct map_desc *desc = NULL;
/*
* Set up the common mapping first; we need this to
* determine whether we're in host mode or not.
*/
iotable_init(fb_common_io_desc);
/*
* Now, work out what we've got to map in addition on this
* platform.
*/
if (machine_is_co285())
desc = co285_io_desc;
else if (footbridge_cfn_mode())
desc = ebsa285_host_io_desc;
if (desc)
iotable_init(desc);
}
#ifdef CONFIG_FOOTBRIDGE_ADDIN
/*
* These two functions convert virtual addresses to PCI addresses and PCI
* addresses to virtual addresses. Note that it is only legal to use these
* on memory obtained via get_free_page or kmalloc.
*/
unsigned long __virt_to_bus(unsigned long res)
{
#ifdef CONFIG_DEBUG_ERRORS
if (res < PAGE_OFFSET || res >= (unsigned long)high_memory) {
printk("__virt_to_bus: invalid virtual address 0x%08lx\n", res);
__backtrace();
}
#endif
return (res - PAGE_OFFSET) + (*CSR_PCISDRAMBASE & 0xfffffff0);
}
unsigned long __bus_to_virt(unsigned long res)
{
res -= (*CSR_PCISDRAMBASE & 0xfffffff0);
res += PAGE_OFFSET;
#ifdef CONFIG_DEBUG_ERRORS
if (res < PAGE_OFFSET || res >= (unsigned long)high_memory) {
printk("__bus_to_virt: invalid virtual address 0x%08lx\n", res);
__backtrace();
}
#endif
return res;
}
#endif
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-footbridge/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:48:12 -0000 1.1.1.1
+++ Makefile 10 Apr 2002 13:51:22 -0000 1.2
@@ -5,42 +5,32 @@
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
+USE_STANDARD_AS_RULE := true
+
O_TARGET := footbridge.o
# Object file lists.
-obj-y := arch.o #dma.o mm.o
+obj-y := arch.o irq.o mm.o #dma.o
obj-m :=
obj-n :=
obj- :=
-export-objs := netwinder-hw.o
+export-objs := arch.o netwinder-hw.o
-ifeq ($(CONFIG_PCI),y)
-obj-$(CONFIG_ARCH_CATS) += cats-pci.o
-obj-$(CONFIG_ARCH_EBSA285) += ebsa285-pci.o
-obj-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o
-obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal-pci.o
-endif
-
-ifeq ($(CONFIG_LEDS),y)
-obj-$(CONFIG_ARCH_CO285) += ebsa285-leds.o
-obj-$(CONFIG_ARCH_EBSA285) += ebsa285-leds.o
-obj-$(CONFIG_ARCH_NETWINDER) += netwinder-leds.o
-endif
+pci-$(CONFIG_ARCH_CATS) += cats-pci.o
+pci-$(CONFIG_ARCH_EBSA285) += ebsa285-pci.o
+pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o
+pci-$(CONFIG_ARCH_PERSONAL_SERVER) += personal-pci.o
+
+leds-$(CONFIG_ARCH_CO285) += ebsa285-leds.o
+leds-$(CONFIG_ARCH_EBSA285) += ebsa285-leds.o
+leds-$(CONFIG_ARCH_NETWINDER) += netwinder-leds.o
obj-$(CONFIG_ARCH_CATS) += cats-hw.o
obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o
-# Files that are both resident and modular; remove from modular.
-
-obj-m := $(filter-out $(obj-y), $(obj-m))
-
-# Translate to Rules.make lists.
-
-O_OBJS := $(filter-out $(export-objs), $(obj-y))
-OX_OBJS := $(filter $(export-objs), $(obj-y))
-M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
-MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
+obj-$(CONFIG_PCI) +=$(pci-y)
+obj-$(CONFIG_LEDS) +=$(leds-y)
include $(TOPDIR)/Rules.make
Index: arch.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-footbridge/arch.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- arch.c 14 Jan 2001 19:48:12 -0000 1.1.1.1
+++ arch.c 10 Apr 2002 13:51:22 -0000 1.2
@@ -7,6 +7,7 @@
* is pulled from the params struct.
*/
#include <linux/config.h>
+#include <linux/module.h>
#include <linux/tty.h>
#include <linux/delay.h>
#include <linux/pm.h>
@@ -19,9 +20,20 @@
#include <asm/mach/arch.h>
-extern void setup_initrd(unsigned int start, unsigned int size);
-extern void setup_ramdisk(int doload, int prompt, int start, unsigned int rd_sz);
-extern void __init footbridge_map_io(void);
+extern void footbridge_map_io(void);
+extern void footbridge_init_irq(void);
+
+unsigned int mem_fclk_21285 = 50000000;
+
+EXPORT_SYMBOL(mem_fclk_21285);
+
+static int __init parse_tag_memclk(const struct tag *tag)
+{
+ mem_fclk_21285 = tag->u.memclk.fmemclk;
+ return 0;
+}
+
+__tagtable(ATAG_MEMCLK, parse_tag_memclk);
#ifdef CONFIG_ARCH_EBSA285
@@ -42,6 +54,7 @@
VIDEO(0x000a0000, 0x000bffff)
FIXUP(fixup_ebsa285)
MAPIO(footbridge_map_io)
+ INITIRQ(footbridge_init_irq)
MACHINE_END
#endif
@@ -73,7 +86,7 @@
printk(KERN_WARNING "Warning: bad NeTTrom parameters "
"detected, using defaults\n");
- params->u1.s.nr_pages = 0x2000; /* 32MB */
+ params->u1.s.nr_pages = 0x1000; /* 16MB */
params->u1.s.ramdisk_size = 0;
params->u1.s.flags = FLAG_READONLY;
params->u1.s.initrd_start = 0;
@@ -91,6 +104,7 @@
DISABLE_PARPORT(2)
FIXUP(fixup_netwinder)
MAPIO(footbridge_map_io)
+ INITIRQ(footbridge_init_irq)
MACHINE_END
#endif
@@ -100,7 +114,7 @@
* hard reboots fail on early boards.
*/
static void __init
-fixup_cats(struct machine_desc *desc, struct param_struct *params,
+fixup_cats(struct machine_desc *desc, struct param_struct *unused,
char **cmdline, struct meminfo *mi)
{
ORIG_VIDEO_LINES = 25;
@@ -111,16 +125,18 @@
MACHINE_START(CATS, "Chalice-CATS")
MAINTAINER("Philip Blundell")
BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
+ BOOT_PARAMS(0x00000100)
SOFT_REBOOT
FIXUP(fixup_cats)
MAPIO(footbridge_map_io)
+ INITIRQ(footbridge_init_irq)
MACHINE_END
#endif
#ifdef CONFIG_ARCH_CO285
static void __init
-fixup_coebsa285(struct machine_desc *desc, struct param_struct *params,
+fixup_coebsa285(struct machine_desc *desc, struct param_struct *unused,
char **cmdline, struct meminfo *mi)
{
extern unsigned long boot_memory_end;
@@ -139,6 +155,7 @@
BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0x7cf00000)
FIXUP(fixup_coebsa285)
MAPIO(footbridge_map_io)
+ INITIRQ(footbridge_init_irq)
MACHINE_END
#endif
@@ -148,5 +165,6 @@
BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
BOOT_PARAMS(0x00000100)
MAPIO(footbridge_map_io)
+ INITIRQ(footbridge_init_irq)
MACHINE_END
#endif
Index: cats-pci.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-footbridge/cats-pci.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- cats-pci.c 14 Jan 2001 19:48:13 -0000 1.1.1.1
+++ cats-pci.c 10 Apr 2002 13:51:22 -0000 1.2
@@ -11,6 +11,7 @@
#include <asm/irq.h>
#include <asm/mach/pci.h>
+#include <asm/hardware/dec21285.h>
/* cats host-specific stuff */
static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
@@ -31,7 +32,9 @@
}
struct hw_pci cats_pci __initdata = {
- init: dc21285_init,
- swizzle: no_swizzle,
- map_irq: cats_map_irq,
+ setup_resources: dc21285_setup_resources,
+ init: dc21285_init,
+ mem_offset: DC21285_PCI_MEM,
+ swizzle: no_swizzle,
+ map_irq: cats_map_irq,
};
Index: ebsa285-pci.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-footbridge/ebsa285-pci.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ebsa285-pci.c 14 Jan 2001 19:48:13 -0000 1.1.1.1
+++ ebsa285-pci.c 10 Apr 2002 13:51:22 -0000 1.2
@@ -11,6 +11,7 @@
#include <asm/irq.h>
#include <asm/mach/pci.h>
+#include <asm/hardware/dec21285.h>
static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
@@ -33,7 +34,9 @@
}
struct hw_pci ebsa285_pci __initdata = {
- init: dc21285_init,
- swizzle: ebsa285_swizzle,
- map_irq: ebsa285_map_irq,
+ setup_resources: dc21285_setup_resources,
+ init: dc21285_init,
+ mem_offset: DC21285_PCI_MEM,
+ swizzle: ebsa285_swizzle,
+ map_irq: ebsa285_map_irq,
};
Index: netwinder-pci.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-footbridge/netwinder-pci.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- netwinder-pci.c 14 Jan 2001 19:48:15 -0000 1.1.1.1
+++ netwinder-pci.c 10 Apr 2002 13:51:22 -0000 1.2
@@ -11,6 +11,7 @@
#include <asm/irq.h>
#include <asm/mach/pci.h>
+#include <asm/hardware/dec21285.h>
/* netwinder host-specific stuff */
static int __init netwinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
@@ -48,7 +49,9 @@
}
struct hw_pci netwinder_pci __initdata = {
- init: dc21285_init,
- swizzle: no_swizzle,
- map_irq: netwinder_map_irq,
+ setup_resources: dc21285_setup_resources,
+ init: dc21285_init,
+ mem_offset: DC21285_PCI_MEM,
+ swizzle: no_swizzle,
+ map_irq: netwinder_map_irq,
};
Index: personal-pci.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-footbridge/personal-pci.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- personal-pci.c 14 Jan 2001 19:48:16 -0000 1.1.1.1
+++ personal-pci.c 10 Apr 2002 13:51:22 -0000 1.2
@@ -11,6 +11,7 @@
#include <asm/irq.h>
#include <asm/mach/pci.h>
+#include <asm/hardware/dec21285.h>
static int irqmap_personal_server[] __initdata = {
IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0,
@@ -37,7 +38,9 @@
}
struct hw_pci personal_server_pci __initdata = {
- init: dc21285_init,
- swizzle: no_swizzle,
- map_irq: personal_server_map_irq,
+ setup_resources: dc21285_setup_resources,
+ init: dc21285_init,
+ mem_offset: DC21285_PCI_MEM,
+ swizzle: no_swizzle,
+ map_irq: personal_server_map_irq,
};
|