Skip to contentSkip to conversation

LASAT updates

PATCH New Brian Murphy 1 participant 1 message Apr 7, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LASAT updates

Hi Ralf,
this patch includes various cleanups and re-impliments pci support
for the Lasat platforms. It includes the machinfo patch I sent before. It also includes a patch to allow an ethernet device to have irq 0 on lasat platforms. I have tried many times to get the network folk to accept a patch but they don't even reply. Interrupt 0 is a very valid interrupt for a pci device (255 means undefined) but on a pc 0 is always taken by the timer so most bioses seem to be broken and set an undefined pci interrupt to 0 and not to 255. Drivers such as pcnet impliment accordingly. Anyway since there are CONFIG_LASAT hacks in pcnet32.c already it should not be a big problem to have one more ;).

I found that I needed to set MAX_HWIFS to 2 in include/asm-mips/mach-generic/ide.h
The ide drivers take forever to time out the probe for the other 16 devices which don't exist on a Lasat board. Is there an official way to disable this probing? Setting MAX_HWIFS does not seem possible except by hacking in this file.

With this patch the Lasat machines seem to have a reasonably stable 2.6.4 support (although crashme can create a process which cannot die without a reset).
Thanks for the hard work guys - the last time I looked at 2.5 support it barely booted.

/Brian

Index: arch/mips/lasat/Makefile
===================================================================
RCS file: /cvs/linux/arch/mips/lasat/Makefile,v
retrieving revision 1.9

mips/lasat/Makefile +0 -1
diff -u -r1.9 Makefile
@@ -7,7 +7,6 @@
 
 obj-$(CONFIG_LASAT_SYSCTL)	+= sysctl.o
 obj-$(CONFIG_DS1603)		+= ds1603.o
-obj-$(CONFIG_PCI)		+= pci.o
 obj-$(CONFIG_PICVUE)		+= picvue.o
 obj-$(CONFIG_PICVUE_PROC)	+= picvue_proc.o
 

Index: arch/mips/lasat/interrupt.c
===================================================================
RCS file: /cvs/linux/arch/mips/lasat/interrupt.c,v retrieving revision 1.9

mips/lasat/interrupt.c +2 -3
diff -u -r1.9 interrupt.c
@@ -33,7 +33,7 @@
 static volatile int *lasat_int_mask = NULL;
 static volatile int lasat_int_mask_shift;
 
-extern asmlinkage void mipsIRQ(void);
+extern asmlinkage void lasatIRQ(void);
 
 void disable_lasat_irq(unsigned int irq_nr)
 {
@@ -141,7 +141,6 @@
 		*lasat_int_mask = 0;
 		break;
 	case MACH_LASAT_200:
-		printk("**** MACH_LASAT_200 interrupt routines\n");
 		lasat_int_status = (void *)LASAT_INT_STATUS_REG_200;
 		lasat_int_mask = (void *)LASAT_INT_MASK_REG_200;
 		lasat_int_mask_shift = LASATINT_MASK_SHIFT_200;
@@ -153,7 +152,7 @@
 	}
 
 	/* Now safe to set the exception vector. */
-	set_except_vector(0, mipsIRQ);
+	set_except_vector(0, lasatIRQ);
 
 	for (i = 0; i <= LASATINT_END; i++) {
 		irq_desc[i].status	= IRQ_DISABLED;

Index: arch/mips/lasat/lasatIRQ.S
===================================================================
RCS file: /cvs/linux/arch/mips/lasat/lasatIRQ.S,v
retrieving revision 1.4

mips/lasat/lasatIRQ.S +7 -6
diff -u -r1.4 lasatIRQ.S
@@ -24,12 +24,13 @@
 
 	.text
 	.set	noreorder
-	.set	noat
 	.align	5
-	NESTED(mipsIRQ, PT_SIZE, sp)
+	NESTED(lasatIRQ, PT_SIZE, sp)
+	.set	noat
 	SAVE_ALL
 	CLI
 	.set	at
+	.set	noreorder
 
 	mfc0	s0, CP0_CAUSE		# get irq mask
 
@@ -39,9 +40,9 @@
 	 andi	a0, s0, CAUSEF_IP2	# delay slot, check hw0 interrupt
 
 	/* Wheee, a timer interrupt. */
-	move	a0, sp
-	jal	lasat_timer_interrupt
-	 nop
+	li	a0, 7
+	jal	ll_timer_interrupt
+	 move	a1, sp
 
 	j	ret_from_irq
 	 nop
@@ -65,4 +66,4 @@
 
 	j	ret_from_irq
 	 nop
-	END(mipsIRQ)
+	END(lasatIRQ)

Index: arch/mips/lasat/setup.c
===================================================================
RCS file: /cvs/linux/arch/mips/lasat/setup.c,v
retrieving revision 1.12

mips/lasat/setup.c +0 -7
diff -u -r1.12 setup.c
@@ -44,7 +44,6 @@
 #endif
 
 #include "ds1603.h"
-#include "at93c.h"
 #include <asm/lasat/ds1603.h>
 #include <asm/lasat/picvue.h>
 #include <asm/lasat/eeprom.h>
@@ -126,12 +125,6 @@
 	change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
 }
 
-#define MIPS_CPU_TIMER_IRQ 7
-asmlinkage void lasat_timer_interrupt(struct pt_regs *regs)
-{
-	ll_timer_interrupt(MIPS_CPU_TIMER_IRQ, regs);
-}
-
 #define DYNAMIC_SERIAL_INIT
 #ifdef DYNAMIC_SERIAL_INIT
 void __init serial_init(void)

Index: arch/mips/lasat/image/Makefile
===================================================================
RCS file: /cvs/linux/arch/mips/lasat/image/Makefile,v retrieving revision 1.6

mips/lasat/image/Makefile +5 -4
diff -u -r1.6 Makefile
@@ -18,14 +18,15 @@
 
 LDSCRIPT= -L$(obj) -Tromscript.normal
 
-AFLAGS_head.o += -D_kernel_start=0x$(KERNEL_START) \
+HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
 		-D_kernel_entry=0x$(KERNEL_ENTRY) \
 		-D VERSION="\"$(Version)\"" \
 		-D TIMESTAMP=$(shell date +%s) 
 
-head.o: $(KERNEL_IMAGE)
+$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
+	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
 
-obj-y = head.o kImage.o
+OBJECTS = head.o kImage.o
 
 rom.sw:	$(obj)/rom.sw
 
@@ -36,7 +37,7 @@
 	$(OBJCOPY) -O binary -S $^ $@
 
 # Rule to make the bootloader
-$(obj)/rom: $(addprefix $(obj)/,$(obj-y))
+$(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
 	$(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^
 
 $(obj)/%.o: $(obj)/%.gz

Index: arch/mips/pci/Makefile
===================================================================
RCS file: /cvs/linux/arch/mips/pci/Makefile,v
retrieving revision 1.13

mips/pci/Makefile +1 -0
diff -u -r1.13 Makefile
@@ -24,6 +24,7 @@
 obj-$(CONFIG_DDB5476)		+= ops-ddb5476.o pci-ddb5476.o
 obj-$(CONFIG_DDB5477)		+= fixup-ddb5477.o pci-ddb5477.o ops-ddb5477.o
 obj-$(CONFIG_HP_LASERJET)	+= pci-hplj.o
+obj-$(CONFIG_LASAT)		+= pci-lasat.o fixup-lasat.o
 obj-$(CONFIG_MIPS_ATLAS)	+= fixup-atlas.o
 obj-$(CONFIG_MIPS_COBALT)	+= fixup-cobalt.o
 obj-$(CONFIG_MIPS_EV96100)	+= fixup-ev64120.o

Index: drivers/net/pcnet32.c
===================================================================
RCS file: /cvs/linux/drivers/net/pcnet32.c,v
retrieving revision 1.59

net/pcnet32.c +4 -1
diff -u -r1.59 pcnet32.c
@@ -1144,7 +1144,10 @@
     int i;
     int rc;
 
-    if (dev->irq == 0 ||
+    if (
+#ifndef CONFIG_LASAT
+        dev->irq == 0 ||
+#endif
 	request_irq(dev->irq, &pcnet32_interrupt,
 		    lp->shared_irq ? SA_SHIRQ : 0, lp->name, (void *)dev)) {
 	return -EAGAIN;

Index: include/asm-mips/bootinfo.h
===================================================================
RCS file: /cvs/linux/include/asm-mips/bootinfo.h,v retrieving revision 1.73

asm-mips/bootinfo.h +2 -2
diff -u -r1.73 bootinfo.h
@@ -200,8 +200,8 @@
  * Valid machtype for group LASAT
  */
 #define MACH_GROUP_LASAT       21
-#define  MACH_LASAT_100		1	/* Masquerade II/SP100/SP50/SP25 */
-#define  MACH_LASAT_200		2	/* Masquerade PRO/SP200 */
+#define  MACH_LASAT_100		0	/* Masquerade II/SP100/SP50/SP25 */
+#define  MACH_LASAT_200		1	/* Masquerade PRO/SP200 */
 
 /*
  * Valid machtype for group TITAN
mips/pci/fixup-lasat.c new file +10 -0
@@ -0,0 +1,10 @@
+#include <linux/init.h>
+#include <linux/pci.h>
+
+void __init pcibios_fixup_irqs(void)
+{
+}
+
+struct pci_fixup pcibios_fixups[] __initdata = {
+    { 0 }
+};
mips/pci/pci-lasat.c new file +89 -0

89 lines not on this page · raw message

mips/lasat/pci.c deleted +0 -25
@@ -1,25 +0,0 @@
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <asm/bootinfo.h>
-
-extern struct pci_ops nile4_pci_ops;
-extern struct pci_ops gt64120_pci_ops;
-
-void __init pcibios_init(void)
-{
-	struct pci_ops *pci_ops;
-
-	switch (mips_machtype) {
-	case MACH_LASAT_100:
-		pci_ops = &gt64120_pci_ops;
-		break;
-	case MACH_LASAT_200:
-		pci_ops = &nile4_pci_ops;
-		break;
-	default:
-		panic("pcibios_init: mips_machtype incorrect");
-	}
-
-	pci_scan_bus(0, pci_ops, NULL);
-}