From: Andy P. <at...@us...> - 2002-04-09 12:33:50
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-arm/arch-ebsa285 In directory usw-pr-cvs1:/tmp/cvs-serv9454/asm-arm/arch-ebsa285 Modified Files: io.h irq.h keyboard.h memory.h system.h time.h Log Message: Synch to 2.4.15 commit 1 Index: io.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-arm/arch-ebsa285/io.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- io.h 25 Feb 2001 23:14:53 -0000 1.1.1.2 +++ io.h 9 Apr 2002 12:33:08 -0000 1.2 @@ -25,14 +25,14 @@ #define __mem_isa(a) (PCIMEM_BASE + (unsigned long)(a)) #else -extern __inline__ unsigned long ___mem_pci(unsigned long a) +static inline unsigned long ___mem_pci(unsigned long a) { if (a <= 0xc0000000 || a >= 0xe0000000) BUG(); return a; } -extern __inline__ unsigned long ___mem_isa(unsigned long a) +static inline unsigned long ___mem_isa(unsigned long a) { if (a >= 16*1048576) BUG(); @@ -48,16 +48,7 @@ #define __arch_getw(a) (*(volatile unsigned short *)(a)) #define __arch_putw(v,a) (*(volatile unsigned short *)(a) = (v)) -#include <asm/hardware/dec21285.h> - -/* - * ioremap support - validate a PCI memory address, - * and convert a PCI memory address to a physical - * address for the page tables. - */ -#define iomem_valid_addr(iomem,sz) \ - ((iomem) < 0x80000000 && (iomem) + (sz) <= 0x80000000) - -#define iomem_to_phys(iomem) ((iomem) + DC21285_PCI_MEM) +#define iomem_valid_addr(iomem,sz) (1) +#define iomem_to_phys(iomem) (iomem) #endif Index: irq.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-arm/arch-ebsa285/irq.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- irq.h 14 Jan 2001 16:58:38 -0000 1.1.1.1 +++ irq.h 9 Apr 2002 12:33:08 -0000 1.2 @@ -19,34 +19,7 @@ #include <asm/irq.h> #include <asm/mach-types.h> -/* - * Footbridge IRQ translation table - * Converts from our IRQ numbers into FootBridge masks - */ -static const int dc21285_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 int isa_irq = -1; +int isa_irq = -1; static inline int fixup_irq(unsigned int irq) { @@ -58,166 +31,3 @@ return irq; } -static void dc21285_mask_irq(unsigned int irq) -{ - *CSR_IRQ_DISABLE = dc21285_irq_mask[_DC21285_INR(irq)]; -} - -static void dc21285_unmask_irq(unsigned int irq) -{ - *CSR_IRQ_ENABLE = dc21285_irq_mask[_DC21285_INR(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 cpl, void *dev_id, struct pt_regs *regs) -{ -} - -static struct irqaction irq_cascade = { no_action, 0, 0, "cascade", NULL, NULL }; -static struct resource pic1_resource = { "pic1", 0x20, 0x3f }; -static struct resource pic2_resource = { "pic2", 0xa0, 0xbf }; - -static __inline__ void irq_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 = dc21285_mask_irq; - irq_desc[irq].mask = dc21285_mask_irq; - irq_desc[irq].unmask = dc21285_unmask_irq; - } - - /* - * Determine the ISA settings for - * the machine we're running on. - */ - isa_irq = -1; - - if (footbridge_cfn_mode()) { - 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_irq = IRQ_PCI; - - if (machine_is_cats()) - isa_irq = IRQ_IN2; - - if (machine_is_netwinder()) - isa_irq = IRQ_IN3; - } - - if (isa_irq != -1) { - /* - * 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 */ - } 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; - } -} Index: keyboard.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-arm/arch-ebsa285/keyboard.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- keyboard.h 14 Jan 2001 16:58:36 -0000 1.1.1.1 +++ keyboard.h 9 Apr 2002 12:33:08 -0000 1.2 @@ -3,13 +3,19 @@ * * Keyboard driver definitions for EBSA285 architecture * - * (C) 1998 Russell King + * Copyright (C) 1998-2001 Russell King * (C) 1998 Phil Blundell */ #include <linux/ioport.h> #include <asm/irq.h> #include <asm/system.h> +#define KEYBOARD_IRQ IRQ_ISA_KEYBOARD +#define NR_SCANCODES 128 + +#define kbd_disable_irq() do { } while (0) +#define kbd_enable_irq() do { } while (0) + extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode); extern int pckbd_getkeycode(unsigned int scancode); extern int pckbd_translate(unsigned char scancode, unsigned char *keycode, @@ -19,55 +25,26 @@ extern void pckbd_init_hw(void); extern unsigned char pckbd_sysrq_xlate[128]; -#define KEYBOARD_IRQ IRQ_ISA_KEYBOARD - -#define NR_SCANCODES 128 +static inline void kbd_init_hw(void) +{ + if (have_isa_bridge) { + k_setkeycode = pckbd_setkeycode; + k_getkeycode = pckbd_getkeycode; + k_translate = pckbd_translate; + k_unexpected_up = pckbd_unexpected_up; + k_leds = pckbd_leds; +#ifdef CONFIG_MAGIC_SYSRQ + k_sysrq_key = 0x54; + k_sysrq_xlate = pckbd_sysrq_xlate; +#endif + pckbd_init_hw(); + } +} -#define kbd_setkeycode(sc,kc) \ - ({ \ - int __ret; \ - if (have_isa_bridge) \ - __ret = pckbd_setkeycode(sc,kc);\ - else \ - __ret = -EINVAL; \ - __ret; \ - }) - -#define kbd_getkeycode(sc) \ - ({ \ - int __ret; \ - if (have_isa_bridge) \ - __ret = pckbd_getkeycode(sc); \ - else \ - __ret = -EINVAL; \ - __ret; \ - }) - -#define kbd_translate(sc, kcp, rm) \ - ({ \ - pckbd_translate(sc, kcp, rm); \ - }) - -#define kbd_unexpected_up pckbd_unexpected_up - -#define kbd_leds(leds) \ - do { \ - if (have_isa_bridge) \ - pckbd_leds(leds); \ - } while (0) - -#define kbd_init_hw() \ - do { \ - if (have_isa_bridge) \ - pckbd_init_hw(); \ - } while (0) -#define kbd_sysrq_xlate pckbd_sysrq_xlate - -#define kbd_disable_irq() -#define kbd_enable_irq() - -#define SYSRQ_KEY 0x54 +/* + * The rest of this file is to do with supporting pc_keyb.c + */ /* resource allocation */ #define kbd_request_region() request_region(0x60, 16, "keyboard") Index: memory.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-arm/arch-ebsa285/memory.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- memory.h 14 Jan 2001 16:58:40 -0000 1.1.1.1 +++ memory.h 9 Apr 2002 12:33:08 -0000 1.2 @@ -80,4 +80,6 @@ #define __phys_to_virt__is_a_macro #define __phys_to_virt(ppage) ((unsigned long)(ppage) + PAGE_OFFSET) +#define PHYS_TO_NID(addr) (0) + #endif Index: system.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-arm/arch-ebsa285/system.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- system.h 14 Jan 2001 16:58:37 -0000 1.1.1.1 +++ system.h 9 Apr 2002 12:33:08 -0000 1.2 @@ -35,7 +35,7 @@ slow_out: } -extern __inline__ void arch_reset(char mode) +static inline void arch_reset(char mode) { if (mode == 's') { /* @@ -63,14 +63,24 @@ */ outb(0xc4, 0x338); } else { - /* To reboot, we set up the 21285 watchdog and - * enable it. We then wait for it to timeout. + /* + * Force the watchdog to do a CPU reset. + * + * After making sure that the watchdog is disabled + * (so we can change the timer registers) we first + * enable the timer to autoreload itself. Next, the + * timer interval is set really short and any + * current interrupt request is cleared (so we can + * see an edge transition). Finally, TIMER4 is + * enabled as the watchdog. */ - *CSR_TIMER4_LOAD = 0x8000; + *CSR_SA110_CNTL &= ~(1 << 13); *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16; - *CSR_SA110_CNTL |= 1 << 13; + *CSR_TIMER4_LOAD = 0x2; + *CSR_TIMER4_CLR = 0; + *CSR_SA110_CNTL |= (1 << 13); } } } Index: time.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-arm/arch-ebsa285/time.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- time.h 14 Jan 2001 16:58:39 -0000 1.1.1.1 +++ time.h 9 Apr 2002 12:33:08 -0000 1.2 @@ -199,7 +199,7 @@ /* * Set up timer interrupt. */ -extern __inline__ void setup_timer(void) +static inline void setup_timer(void) { int irq; |