Skip to contentSkip to conversation

More Motorola diffs

PATCH Johnnie Peters 1 participant 1 message Jun 15, 1999

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

Hi Everybody,

Here is the next set of diff files for the Motorola platforms. The only read addition is new SMP code that gets the second processor up and running on the Dual MTX and MVME4600 boards. It runs into a locking problem pretty quickly but I have been able to completly compile the kernel a couple of times.

I welcome mail and suggestions for making it better.

Johnnie

arch/ppc/config.in +0 -1
diff -u -r --new-file linux-2.2.10_4/arch/ppc/config.in linux-2.1/arch/ppc/config.in
@@ -92,7 +92,6 @@
 bool 'Support for Open Firmware device tree in /proc' CONFIG_PROC_DEVICETREE
 bool 'Support for TotalImpact TotalMP' CONFIG_TOTALMP
 bool 'Support for early boot text console (BootX only)' CONFIG_BOOTX_TEXT
-bool 'Support for Motorola Hot Swap' CONFIG_MOTOROLA_HOTSWAP
 if [ "$CONFIG_PREP" = "y" -o "$CONFIG_ALL_PPC" = "y" ]; then
   bool 'PReP bootloader kernel arguments' CONFIG_CMDLINE_BOOL y
   if [ "$CONFIG_CMDLINE_BOOL" = "y" ] ; then
arch/ppc/kernel/Makefile +1 -1
diff -u -r --new-file linux-2.2.10_4/arch/ppc/kernel/Makefile linux-2.1/arch/ppc/kernel/Makefile
@@ -65,7 +65,7 @@
 	$(HOSTCC) -o find_name find_name.c
 
 checks: checks.c
-	$(HOSTCC) ${CFLAGS} -D__KERNEL__ -o checks checks.c
+	$(CC) ${CFLAGS} -D__KERNEL__ -o checks checks.c
 	./checks
 
 include $(TOPDIR)/Rules.make
arch/ppc/kernel/i8259.c +23 -24

69 lines not on this page · raw message

arch/ppc/kernel/irq.c +11 -8
diff -u -r --new-file linux-2.2.10_4/arch/ppc/kernel/irq.c linux-2.1/arch/ppc/kernel/irq.c
@@ -1,5 +1,5 @@
 /*
- * $Id: irq.c,v 1.105.2.1 1999/05/29 19:10:05 cort Exp $
+ * $Id: irq.c,v 1.29 1999/06/01 17:05:21 jpeters Exp $
  *
  *  arch/ppc/kernel/irq.c
  *
@@ -139,13 +139,16 @@
 		/* Free */
 		for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next)
 		{
-			/* Found it - now free it */
-			save_flags(flags);
-			cli();
-			*p = action->next;
-			restore_flags(flags);
-			irq_kfree(action);
-			return 0;
+			if (action->dev_id == dev_id)
+			{
+				/* Found it - now free it */
+				save_flags(flags);
+				cli();
+				*p = action->next;
+				restore_flags(flags);
+				irq_kfree(action);
+				return 0;
+			}
 		}
 		return -ENOENT;
 	}
arch/ppc/kernel/prep_pci.c +129 -28

207 lines not on this page · raw message

arch/ppc/kernel/prep_setup.c +12 -1
diff -u -r --new-file linux-2.2.10_4/arch/ppc/kernel/prep_setup.c linux-2.1/arch/ppc/kernel/prep_setup.c
@@ -84,7 +84,6 @@
 extern unsigned char pckbd_sysrq_xlate[128];
 
 extern void prep_setup_pci_ptrs(void);
-extern void chrp_do_IRQ(struct pt_regs *regs, int cpu, int isfake);
 extern char saved_command_line[256];
 
 int _prep_type;
@@ -704,15 +703,27 @@
 }
 #endif
 
+unsigned long *MotSave_SmpIar;
+unsigned char *MotSave_CpusState[2];
+
 __initfunc(void
 prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	  unsigned long r6, unsigned long r7))
 {
+	RESIDUAL *old_res = (RESIDUAL *)(r3 + KERNELBASE);
+
 	/* make a copy of residual data */
 	if ( r3 )
 	{
 		memcpy((void *)res,(void *)(r3+KERNELBASE),
 		       sizeof(RESIDUAL));
+
+		/* These need to be saved for the Motorola Prep 
+		 * MVME4600 and Dual MTX boards.
+		 */
+		MotSave_SmpIar = &old_res->VitalProductData.SmpIar;
+		MotSave_CpusState[0] = &old_res->Cpus[0].CpuState;
+		MotSave_CpusState[1] = &old_res->Cpus[1].CpuState;
 	}
 
 	isa_io_base = PREP_ISA_IO_BASE;
arch/ppc/kernel/smp.c +25 -9
diff -u -r --new-file linux-2.2.10_4/arch/ppc/kernel/smp.c linux-2.1/arch/ppc/kernel/smp.c
@@ -1,5 +1,5 @@
 /*
- * $Id: smp.c,v 1.49.2.1 1999/05/29 19:10:20 cort Exp $
+ * $Id: smp.c,v 1.16 1999/06/09 20:14:22 jpeters Exp $
  *
  * Smp support for ppc.
  *
@@ -57,6 +57,10 @@
 extern int cpu_idle(void *unused);
 u_int openpic_read(volatile u_int *addr);
 
+extern int mot_multi;
+extern unsigned long *MotSave_SmpIar;
+extern unsigned char *MotSave_CpusState[2];
+
 /* register for interrupting the secondary processor on the powersurge */
 #define PSURGE_INTR	((volatile unsigned *)0xf80000c0)
 
@@ -171,7 +175,7 @@
 void smp_message_pass(int target, int msg, unsigned long data, int wait)
 {
 	int i;
-	if ( !(_machine & (_MACH_Pmac|_MACH_chrp)) )
+	if ( !(_machine & (_MACH_Pmac|_MACH_chrp|_MACH_prep)) )
 		return;
 
 	spin_lock(&mesg_pass_lock);
@@ -197,8 +201,8 @@
 		break;
 	}
 	
-	if ( _machine == _MACH_Pmac )
-	{
+	switch (_machine) {
+	case _MACH_Pmac:
 		/* interrupt secondary processor */
 		out_be32(PSURGE_INTR, ~0);
 		out_be32(PSURGE_INTR, 0);
@@ -208,10 +212,10 @@
 		 */
 		/* interrupt primary */
 		/**(volatile unsigned long *)(0xf3019000);*/
-	}
+		break;
 	
-	if ( _machine == _MACH_chrp )
-	{
+	case _MACH_chrp:
+	case _MACH_prep:
 		/*
 		 * There has to be some way of doing this better -
 		 * perhaps a sent-to-all or send-to-all-but-self
@@ -234,6 +238,7 @@
 			openpic_cause_IPI(target, 0, 1U << target);
 			break;
 		}
+		break;
 	}
 	
 	spin_unlock(&mesg_pass_lock);
@@ -274,8 +279,10 @@
 
 	if ( !(_machine & (_MACH_Pmac|_MACH_chrp)) )
 	{
-		printk("SMP not supported on this machine.\n");
-		return;
+		if (!((_machine & _MACH_prep) && mot_multi)) {
+			printk("SMP not supported on this machine.\n");
+			return;
+		}
 	}
 	
 	switch ( _machine )
@@ -293,6 +300,10 @@
 		       smp_num_cpus,
 		       10/*openpic_read(&OpenPIC->Processor[0]._Who_Am_I)*/);
 		break;
+	case _MACH_prep:
+		/* assume 2 for now == fix later -- Johnnie */
+                smp_num_cpus = 2;  
+                break;
 	}
 
 	/*
@@ -332,6 +343,11 @@
 		case _MACH_chrp:
 			*(unsigned long *)KERNELBASE = i;
 			asm volatile("dcbf 0,%0"::"r"(KERNELBASE):"memory");
+			break;
+		case _MACH_prep:
+			*MotSave_SmpIar = (unsigned long)__secondary_start_psurge - KERNELBASE;
+			*MotSave_CpusState[1] = CPU_GOOD;
+			printk("CPU1 reset, waiting\n");
 			break;
 		}
 		
drivers/block/cmd646.c +1 -1
@@ -1,4 +1,4 @@
-/* $Id: cmd646.c,v 1.11 1998/12/13 08:36:54 davem Exp $
+/* $Id: cmd646.c,v 1.3 1998/12/22 00:23:53 jpeters Exp $
  * cmd646.c: Enable interrupts at initialization time on Ultra/PCI machines.
  *           Note, this driver is not used at all on other systems because
  *           there the "BIOS" has done all of the following already.
drivers/block/genhd.c +0 -0
diff -u -r --new-file linux-2.2.10_4/drivers/block/genhd.c linux-2.1/drivers/block/genhd.c
@@ -816,12 +831,12 @@
 	magic = label->magic_mushroom;
 	if(be32_to_cpu(magic) != SGI_LABEL_MAGIC) {
 		printk("Dev %s SGI disklabel: bad magic %08x\n",
		       kdevname(dev), magic);

brelse(bh);
return 0;
}
ui = ((unsigned int *) (label + 1)) - 1;
- for(csum = 0; ui >= ((unsigned int *) label);) {
+ or(csum = 0; ui >= ((unsigned int *) label);) {
cs = *ui--;
csum += be32_to_cpu(cs);
}

drivers/char/Config.in +3 -0
diff -u -r --new-file linux-2.2.10_4/drivers/char/Config.in linux-2.1/drivers/char/Config.in
@@ -64,6 +64,9 @@
 	tristate 'Logitech busmouse support' CONFIG_BUSMOUSE
 	tristate 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE
 	bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE
+	if [ "$CONFIG_PSMOUSE" = "y" ]; then
+		bool '  Init PS/2 mouse' INITIALIZE_PSMOUSE
+	fi
 	tristate 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE
 	tristate 'PC110 digitizer pad support' CONFIG_PC110_PAD
 	endmenu
drivers/char/keyboard.c +14 -4
diff -u -r --new-file linux-2.2.10_4/drivers/char/keyboard.c linux-2.1/drivers/char/keyboard.c
@@ -67,6 +67,9 @@
 struct wait_queue * keypress_wait = NULL;
 struct console;
 
+/* Keyboard presence flag */
+int kbd_present = 1;   /* Keyboard present by default */
+
 int keyboard_wait_for_keypress(struct console *co)
 {
 	sleep_on(&keypress_wait);
@@ -909,8 +913,15 @@
 
 	ttytab = console_driver.table;
 
-	kbd_init_hw();
-	init_bh(KEYBOARD_BH, kbd_bh);
-	mark_bh(KEYBOARD_BH);
-	return 0;
+	if (kbd_present)
+	{
+		kbd_init_hw();
+
+		init_bh(KEYBOARD_BH, kbd_bh);
+		mark_bh(KEYBOARD_BH);
+
+		return 0;
+	}
+	else
+		return 1;
 }
drivers/char/pc_keyb.c +0 -0
diff -u -r --new-file linux-2.2.10_4/drivers/char/pc_keyb.c linux-2.1/drivers/char/pc_keyb.c
@@ -848,7 +848,8 @@
 		aux_count--;
 		return -EBUSY;
 	}
	kb_wait();
	kbd_write(KBD_CNTL_REG, KBD_CCMD_MOUSE_ENABLE);	/* Enable the

auxiliary port on controller. */
aux_write_ack(AUX_ENABLE_DEV); /* Enable aux device */
@@ -966,8 +967,10 @@
queue->head = queue->tail = 0;
queue->proc_list = NULL;

-#ifdef INITIALIZE_MOUSE
- kbd_write(KBD_CNTL_REG, KBD_CCMD_MOUSE_ENABLE); /* Enable Aux. */
+#ifdef INITIALIZE_PSMOUSE
+ kbd_write(KBD_CNTL_REG, KBD_CCMD_MOUSE_ENABLE); /* Enable Aux. */
+ aux_write_ack(AUX_RESET);
+ aux_write_ack(AUX_SET_DEFAULT);
aux_write_ack(AUX_SET_SAMPLE);
aux_write_ack(100); /* 100 samples/sec */
aux_write_ack(AUX_SET_RES);

drivers/char/pc_keyb.h +1 -1
diff -u -r --new-file linux-2.2.10_4/drivers/char/pc_keyb.h linux-2.1/drivers/char/pc_keyb.h
@@ -14,7 +14,6 @@
 #define KBD_REPORT_UNKN			/* Report unknown scan codes */
 #define KBD_REPORT_TIMEOUTS		/* Report keyboard timeouts */
 #undef KBD_IS_FOCUS_9000		/* We have the brain-damaged FOCUS-9000 keyboard */
-#undef INITIALIZE_MOUSE			/* Define if your PS/2 mouse needs initialization. */
 
 
 
@@ -113,6 +112,7 @@
 #define AUX_SET_SAMPLE		0xF3	/* Set sample rate */
 #define AUX_ENABLE_DEV		0xF4	/* Enable aux device */
 #define AUX_DISABLE_DEV		0xF5	/* Disable aux device */
+#define AUX_SET_DEFAULT		0xF6	/* Set to default state */
 #define AUX_RESET		0xFF	/* Reset aux device */
 #define AUX_ACK			0xFA	/* Command byte ACK. */
 
drivers/pci/oldproc.c +0 -0
diff -u -r --new-file linux-2.2.10_4/drivers/pci/oldproc.c linux-2.1/drivers/pci/oldproc.c
@@ -378,9 +378,10 @@
 	DEVICE( VORTEX,		VORTEX_GDT6557RP2,"GDT 6557RP2"),
 	DEVICE( VORTEX,		VORTEX_GDT6x11RP2,"GDT 6111RP2/6511RP2"),
 	DEVICE( VORTEX,		VORTEX_GDT6x21RP2,"GDT 6121RP2/6521RP2"),
	DEVICE( EF,		EF_ATM_FPGA,   	"155P-MF1 (FPGA)"),
	DEVICE( EF,		EF_ATM_ASIC,    "155P-MF1 (ASIC)"),
	DEVICE( IDT,		IDT_NICSTAR,	"NICStAR"),
	DEVICE( FORE,		FORE_PCA200PC,  "PCA-200PC"),

DEVICE( FORE, FORE_PCA200E, "PCA-200E"),
DEVICE( IMAGINGTECH, IMAGINGTECH_ICPCI, "MVC IC-PCI"),
DEVICE( PHILIPS, PHILIPS_SAA7145,"SAA7145"),
@@ -778,6 +779,7 @@
case PCI_VENDOR_ID_SMC2: return "SMC";
case PCI_VENDOR_ID_VORTEX: return "VORTEX";
case PCI_VENDOR_ID_EF: return "Efficient Networks";
+ case PCI_VENDOR_ID_IDT: return "IDT";
case PCI_VENDOR_ID_FORE: return "Fore Systems";
case PCI_VENDOR_ID_IMAGINGTECH: return "Imaging Technology";
case PCI_VENDOR_ID_PHILIPS: return "Philips";

include/asm-ppc/io.h +2 -2
diff -u -r --new-file linux-2.2.10_4/include/asm-ppc/io.h linux-2.1/include/asm-ppc/io.h
@@ -42,7 +42,7 @@
 #define writeb(b,addr) out_8((volatile unsigned char *)(addr), (b))
 #if defined(CONFIG_APUS)
 #define readw(addr) (*(volatile unsigned short *) (addr))
-#define readl(addr) (*(volatile unsigned int *) (addr))
+#define readl(addr) in_le32((volatile unsigned *)(addr))
 #define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
 #define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
 #else
@@ -77,7 +77,7 @@
 #define outb_p(val, port)	out_8((unsigned char *)((port)+_IO_BASE), (val))
 #define inw_p(port)		in_le16((unsigned short *)((port)+_IO_BASE))
 #define outw_p(val, port)	out_le16((unsigned short *)((port)+_IO_BASE), (val))
-#define inl_p(port)		in_le32(((unsigned *)(port)+_IO_BASE))
+#define inl_p(port)		in_le32((unsigned *)((port)+_IO_BASE))
 #define outl_p(val, port)	out_le32((unsigned *)((port)+_IO_BASE), (val))
 
 extern void _insb(volatile unsigned char *port, void *buf, int ns);
include/linux/pci.h +3 -0
diff -u -r --new-file linux-2.2.10_4/include/linux/pci.h linux-2.1/include/linux/pci.h
@@ -794,6 +794,9 @@
 #define PCI_DEVICE_ID_EF_ATM_FPGA	0x0000
 #define PCI_DEVICE_ID_EF_ATM_ASIC	0x0002
 
+#define PCI_VENDOR_ID_IDT		0x111d
+#define PCI_DEVICE_ID_IDT_NICSTAR	0x0001
+
 #define PCI_VENDOR_ID_FORE		0x1127
 #define PCI_DEVICE_ID_FORE_PCA200PC	0x0210
 #define PCI_DEVICE_ID_FORE_PCA200E	0x0300