diff options
Diffstat (limited to 'arch/mips/dec')
| -rw-r--r-- | arch/mips/dec/Makefile | 2 | ||||
| -rw-r--r-- | arch/mips/dec/ecc-berr.c | 1 | ||||
| -rw-r--r-- | arch/mips/dec/int-handler.S | 8 | ||||
| -rw-r--r-- | arch/mips/dec/ioasic-irq.c | 43 | ||||
| -rw-r--r-- | arch/mips/dec/kn02xa-berr.c | 1 | ||||
| -rw-r--r-- | arch/mips/dec/platform.c | 44 | ||||
| -rw-r--r-- | arch/mips/dec/prom/Makefile | 1 | ||||
| -rw-r--r-- | arch/mips/dec/prom/call_o32.S | 89 | ||||
| -rw-r--r-- | arch/mips/dec/prom/init.c | 3 | ||||
| -rw-r--r-- | arch/mips/dec/prom/memory.c | 2 | ||||
| -rw-r--r-- | arch/mips/dec/setup.c | 9 | 
11 files changed, 98 insertions, 105 deletions
diff --git a/arch/mips/dec/Makefile b/arch/mips/dec/Makefile index 3d5d2c56de8..bd74e05c90b 100644 --- a/arch/mips/dec/Makefile +++ b/arch/mips/dec/Makefile @@ -3,7 +3,7 @@  #  obj-y		:= ecc-berr.o int-handler.o ioasic-irq.o kn01-berr.o \ -		   kn02-irq.o kn02xa-berr.o reset.o setup.o time.o +		   kn02-irq.o kn02xa-berr.o platform.o reset.o setup.o time.o  obj-$(CONFIG_TC)		+= tc.o  obj-$(CONFIG_CPU_HAS_WB)	+= wbflush.o diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c index 5abf4e89421..2a66e908f6a 100644 --- a/arch/mips/dec/ecc-berr.c +++ b/arch/mips/dec/ecc-berr.c @@ -21,6 +21,7 @@  #include <asm/addrspace.h>  #include <asm/bootinfo.h>  #include <asm/cpu.h> +#include <asm/cpu-type.h>  #include <asm/irq_regs.h>  #include <asm/processor.h>  #include <asm/ptrace.h> diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S index 22afed16ccd..41a2fa1fa12 100644 --- a/arch/mips/dec/int-handler.S +++ b/arch/mips/dec/int-handler.S @@ -118,7 +118,7 @@   *	       7	FPU/R4k timer   *   * We handle the IRQ according to _our_ priority (see setup.c), - * then we just return.	 If multiple IRQs are pending then we will + * then we just return.  If multiple IRQs are pending then we will   * just take another exception, big deal.   */  		.align	5 @@ -146,7 +146,7 @@  		/*  		 * Find irq with highest priority  		 */ -		 PTR_LA t1,cpu_mask_nr_tbl +		 PTR_LA	t1,cpu_mask_nr_tbl  1:		lw	t2,(t1)  		nop  		and	t2,t0 @@ -195,7 +195,7 @@  		/*  		 * Find irq with highest priority  		 */ -		 PTR_LA t1,asic_mask_nr_tbl +		 PTR_LA	t1,asic_mask_nr_tbl  2:		lw	t2,(t1)  		nop  		and	t2,t0 @@ -221,7 +221,7 @@  		FEXPORT(cpu_all_int)		# HALT, timers, software junk  		li	a0,DEC_CPU_IRQ_BASE  		srl	t0,CAUSEB_IP -		li	t1,CAUSEF_IP>>CAUSEB_IP # mask +		li	t1,CAUSEF_IP>>CAUSEB_IP	# mask  		b	1f  		 li	t2,4			# nr of bits / 2 diff --git a/arch/mips/dec/ioasic-irq.c b/arch/mips/dec/ioasic-irq.c index 4b3e3a4375a..e04d973ce5a 100644 --- a/arch/mips/dec/ioasic-irq.c +++ b/arch/mips/dec/ioasic-irq.c @@ -1,7 +1,7 @@  /*   *	DEC I/O ASIC interrupts.   * - *	Copyright (c) 2002, 2003  Maciej W. Rozycki + *	Copyright (c) 2002, 2003, 2013  Maciej W. Rozycki   *   *	This program is free software; you can redistribute it and/or   *	modify it under the terms of the GNU General Public License @@ -51,22 +51,51 @@ static struct irq_chip ioasic_irq_type = {  	.irq_unmask = unmask_ioasic_irq,  }; -void clear_ioasic_dma_irq(unsigned int irq) +static void clear_ioasic_dma_irq(struct irq_data *d)  {  	u32 sir; -	sir = ~(1 << (irq - ioasic_irq_base)); +	sir = ~(1 << (d->irq - ioasic_irq_base));  	ioasic_write(IO_REG_SIR, sir); +	fast_iob();  }  static struct irq_chip ioasic_dma_irq_type = {  	.name = "IO-ASIC-DMA", -	.irq_ack = ack_ioasic_irq, +	.irq_ack = clear_ioasic_dma_irq,  	.irq_mask = mask_ioasic_irq, -	.irq_mask_ack = ack_ioasic_irq,  	.irq_unmask = unmask_ioasic_irq, +	.irq_eoi = clear_ioasic_dma_irq,  }; +/* + * I/O ASIC implements two kinds of DMA interrupts, informational and + * error interrupts. + * + * The formers do not stop DMA and should be cleared as soon as possible + * so that if they retrigger before the handler has completed, usually as + * a side effect of actions taken by the handler, then they are reissued. + * These use the `handle_edge_irq' handler that clears the request right + * away. + * + * The latters stop DMA and do not resume it until the interrupt has been + * cleared.  This cannot be done until after a corrective action has been + * taken and this also means they will not retrigger.  Therefore they use + * the `handle_fasteoi_irq' handler that only clears the request on the + * way out.  Because MIPS processor interrupt inputs, one of which the I/O + * ASIC is cascaded to, are level-triggered it is recommended that error + * DMA interrupt action handlers are registered with the IRQF_ONESHOT flag + * set so that they are run with the interrupt line masked. + * + * This mask has `1' bits in the positions of informational interrupts. + */ +#define IO_IRQ_DMA_INFO							\ +	(IO_IRQ_MASK(IO_INR_SCC0A_RXDMA) |				\ +	 IO_IRQ_MASK(IO_INR_SCC1A_RXDMA) |				\ +	 IO_IRQ_MASK(IO_INR_ISDN_TXDMA) |				\ +	 IO_IRQ_MASK(IO_INR_ISDN_RXDMA) |				\ +	 IO_IRQ_MASK(IO_INR_ASC_DMA)) +  void __init init_ioasic_irqs(int base)  {  	int i; @@ -79,7 +108,9 @@ void __init init_ioasic_irqs(int base)  		irq_set_chip_and_handler(i, &ioasic_irq_type,  					 handle_level_irq);  	for (; i < base + IO_IRQ_LINES; i++) -		irq_set_chip(i, &ioasic_dma_irq_type); +		irq_set_chip_and_handler(i, &ioasic_dma_irq_type, +					 1 << (i - base) & IO_IRQ_DMA_INFO ? +					 handle_edge_irq : handle_fasteoi_irq);  	ioasic_irq_base = base;  } diff --git a/arch/mips/dec/kn02xa-berr.c b/arch/mips/dec/kn02xa-berr.c index f434b759e3b..ec606363b80 100644 --- a/arch/mips/dec/kn02xa-berr.c +++ b/arch/mips/dec/kn02xa-berr.c @@ -19,6 +19,7 @@  #include <linux/types.h>  #include <asm/addrspace.h> +#include <asm/cpu-type.h>  #include <asm/irq_regs.h>  #include <asm/ptrace.h>  #include <asm/traps.h> diff --git a/arch/mips/dec/platform.c b/arch/mips/dec/platform.c new file mode 100644 index 00000000000..c7ac86af847 --- /dev/null +++ b/arch/mips/dec/platform.c @@ -0,0 +1,44 @@ +/* + *	DEC platform devices. + * + *	Copyright (c) 2014  Maciej W. Rozycki + * + *	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/ioport.h> +#include <linux/kernel.h> +#include <linux/mc146818rtc.h> +#include <linux/platform_device.h> + +static struct resource dec_rtc_resources[] = { +	{ +		.name = "rtc", +		.flags = IORESOURCE_MEM, +	}, +}; + +static struct cmos_rtc_board_info dec_rtc_info = { +	.flags = CMOS_RTC_FLAGS_NOFREQ, +	.address_space = 64, +}; + +static struct platform_device dec_rtc_device = { +	.name = "rtc_cmos", +	.id = PLATFORM_DEVID_NONE, +	.dev.platform_data = &dec_rtc_info, +	.resource = dec_rtc_resources, +	.num_resources = ARRAY_SIZE(dec_rtc_resources), +}; + +static int __init dec_add_devices(void) +{ +	dec_rtc_resources[0].start = RTC_PORT(0); +	dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1; +	return platform_device_register(&dec_rtc_device); +} + +device_initcall(dec_add_devices); diff --git a/arch/mips/dec/prom/Makefile b/arch/mips/dec/prom/Makefile index 064ae7a76bd..ae73e42ac20 100644 --- a/arch/mips/dec/prom/Makefile +++ b/arch/mips/dec/prom/Makefile @@ -6,4 +6,3 @@  lib-y			+= init.o memory.o cmdline.o identify.o console.o  lib-$(CONFIG_32BIT)	+= locore.o -lib-$(CONFIG_64BIT)	+= call_o32.o diff --git a/arch/mips/dec/prom/call_o32.S b/arch/mips/dec/prom/call_o32.S deleted file mode 100644 index c0d1522d448..00000000000 --- a/arch/mips/dec/prom/call_o32.S +++ /dev/null @@ -1,89 +0,0 @@ -/* - *	O32 interface for the 64 (or N32) ABI. - * - *	Copyright (C) 2002  Maciej W. Rozycki - * - *	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 <asm/asm.h> -#include <asm/regdef.h> - -/* Maximum number of arguments supported.  Must be even!  */ -#define O32_ARGC	32 -/* Number of static registers we save.	*/ -#define O32_STATC	11 -/* Frame size for both of the above.  */ -#define O32_FRAMESZ	(4 * O32_ARGC + SZREG * O32_STATC) - -		.text - -/* - * O32 function call dispatcher, for interfacing 32-bit ROM routines. - * - * The standard 64 (N32) calling sequence is supported, with a0 - * holding a function pointer, a1-a7 -- its first seven arguments - * and the stack -- remaining ones (up to O32_ARGC, including a1-a7). - * Static registers, gp and fp are preserved, v0 holds a result. - * This code relies on the called o32 function for sp and ra - * restoration and thus both this dispatcher and the current stack - * have to be placed in a KSEGx (or KUSEG) address space.  Any - * pointers passed have to point to addresses within one of these - * spaces as well. - */ -NESTED(call_o32, O32_FRAMESZ, ra) -		REG_SUBU	sp,O32_FRAMESZ - -		REG_S		ra,O32_FRAMESZ-1*SZREG(sp) -		REG_S		fp,O32_FRAMESZ-2*SZREG(sp) -		REG_S		gp,O32_FRAMESZ-3*SZREG(sp) -		REG_S		s7,O32_FRAMESZ-4*SZREG(sp) -		REG_S		s6,O32_FRAMESZ-5*SZREG(sp) -		REG_S		s5,O32_FRAMESZ-6*SZREG(sp) -		REG_S		s4,O32_FRAMESZ-7*SZREG(sp) -		REG_S		s3,O32_FRAMESZ-8*SZREG(sp) -		REG_S		s2,O32_FRAMESZ-9*SZREG(sp) -		REG_S		s1,O32_FRAMESZ-10*SZREG(sp) -		REG_S		s0,O32_FRAMESZ-11*SZREG(sp) - -		move		jp,a0 - -		sll		a0,a1,zero -		sll		a1,a2,zero -		sll		a2,a3,zero -		sll		a3,a4,zero -		sw		a5,0x10(sp) -		sw		a6,0x14(sp) -		sw		a7,0x18(sp) - -		PTR_LA		t0,O32_FRAMESZ(sp) -		PTR_LA		t1,0x1c(sp) -		li		t2,O32_ARGC-7 -1: -		lw		t3,(t0) -		REG_ADDU	t0,SZREG -		sw		t3,(t1) -		REG_SUBU	t2,1 -		REG_ADDU	t1,4 -		bnez		t2,1b - -		jalr		jp - -		REG_L		s0,O32_FRAMESZ-11*SZREG(sp) -		REG_L		s1,O32_FRAMESZ-10*SZREG(sp) -		REG_L		s2,O32_FRAMESZ-9*SZREG(sp) -		REG_L		s3,O32_FRAMESZ-8*SZREG(sp) -		REG_L		s4,O32_FRAMESZ-7*SZREG(sp) -		REG_L		s5,O32_FRAMESZ-6*SZREG(sp) -		REG_L		s6,O32_FRAMESZ-5*SZREG(sp) -		REG_L		s7,O32_FRAMESZ-4*SZREG(sp) -		REG_L		gp,O32_FRAMESZ-3*SZREG(sp) -		REG_L		fp,O32_FRAMESZ-2*SZREG(sp) -		REG_L		ra,O32_FRAMESZ-1*SZREG(sp) - -		REG_ADDU	sp,O32_FRAMESZ -		jr		ra -END(call_o32) diff --git a/arch/mips/dec/prom/init.c b/arch/mips/dec/prom/init.c index ab169046e44..4e1761e0a09 100644 --- a/arch/mips/dec/prom/init.c +++ b/arch/mips/dec/prom/init.c @@ -13,6 +13,7 @@  #include <asm/bootinfo.h>  #include <asm/cpu.h> +#include <asm/cpu-type.h>  #include <asm/processor.h>  #include <asm/dec/prom.h> @@ -103,7 +104,7 @@ void __init prom_init(void)  	if (prom_is_rex(magic))  		rex_clear_cache(); -	/* Register the early console.	*/ +	/* Register the early console.  */  	register_prom_console();  	/* Were we compiled with the right CPU option? */ diff --git a/arch/mips/dec/prom/memory.c b/arch/mips/dec/prom/memory.c index 0aadac74290..8c62316f22f 100644 --- a/arch/mips/dec/prom/memory.c +++ b/arch/mips/dec/prom/memory.c @@ -22,7 +22,7 @@ volatile unsigned long mem_err;		/* So we know an error occurred */  /*   * Probe memory in 4MB chunks, waiting for an error to tell us we've fallen - * off the end of real memory.	Only suitable for the 2100/3100's (PMAX). + * off the end of real memory.  Only suitable for the 2100/3100's (PMAX).   */  #define CHUNK_SIZE 0x400000 diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c index 741cb4235bd..41bbffd9cc0 100644 --- a/arch/mips/dec/setup.c +++ b/arch/mips/dec/setup.c @@ -23,6 +23,7 @@  #include <asm/bootinfo.h>  #include <asm/cpu.h>  #include <asm/cpu-features.h> +#include <asm/cpu-type.h>  #include <asm/irq.h>  #include <asm/irq_cpu.h>  #include <asm/mipsregs.h> @@ -65,7 +66,7 @@ EXPORT_SYMBOL(ioasic_base);  /*   * IRQ routing and priority tables.  Priorites are set as follows:   * - *		KN01	KN230	KN02	KN02-BA KN02-CA KN03 + *		KN01	KN230	KN02	KN02-BA	KN02-CA	KN03   *   * MEMORY	CPU	CPU	CPU	ASIC	CPU	CPU   * RTC		CPU	CPU	CPU	ASIC	CPU	CPU @@ -413,7 +414,7 @@ static void __init dec_init_kn02(void)  /*   * Machine-specific initialisation for KN02-BA, aka DS5000/1xx - * (xx = 20, 25, 33), aka 3min.	 Also applies to KN04(-BA), aka + * (xx = 20, 25, 33), aka 3min.  Also applies to KN04(-BA), aka   * DS5000/150, aka 4min.   */  static int kn02ba_interrupt[DEC_NR_INTS] __initdata = { @@ -748,6 +749,10 @@ void __init arch_init_irq(void)  		cpu_fpu_mask = 0;  		dec_interrupt[DEC_IRQ_FPU] = -1;  	} +	/* Free the halt interrupt unused on R4k systems.  */ +	if (current_cpu_type() == CPU_R4000SC || +	    current_cpu_type() == CPU_R4400SC) +		dec_interrupt[DEC_IRQ_HALT] = -1;  	/* Register board interrupts: FPU and cascade. */  	if (dec_interrupt[DEC_IRQ_FPU] >= 0)  | 
