Skip to contentSkip to conversation

Support for Motorola Platforms

PATCH Johnnie Peters 1 participant 1 message Jun 4, 1999

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

Hi Everybody,

Here are the changes to the vger tree for Motorola platform support. They are current to the vger tree from about noon pacific time today.

I hope somebody finds them usefull.

Johnnie Peters
Motorola Computer Group

arch/ppc/boot/misc.c +45 -14
diff -u -r --new-file linux-2.2.10_2/arch/ppc/boot/misc.c linux.jp/arch/ppc/boot/misc.c
@@ -1,7 +1,7 @@
 /*
  * misc.c
  *
- * $Id: misc.c,v 1.64.2.2 1999/05/29 19:09:29 cort Exp $
+ * $Id: misc.c,v 1.27 1999/05/28 14:52:00 jpeters Exp $
  * 
  * Adapted for PowerPC by Gary Thomas
  *
@@ -311,6 +311,26 @@
 
 unsigned char sanity[0x2000];
 
+/*
+ * This routine is used to park the second processor on the 
+ * Motorola dual processor platforms.  This will be replaced
+ * in the future by the functionality to start it.
+ */
+void
+park_cpus()
+{
+	volatile unsigned long *smp_iar = &(hold_residual->VitalProductData.SmpIar);
+	int i;
+	
+	/* Wait for indication to park. */
+	while (*smp_iar == 0) {
+                for (i=0; i < 512; i++);
+	}
+
+	/* Wait forever */
+	while(1);
+}
+
 unsigned long
 decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
 		  RESIDUAL *residual, void *OFW_interface)
@@ -368,6 +388,16 @@
 					keyb_present = 0;	/* no keyboard */
 				}
 			}
+
+			/* If this is a multiprocessor system then
+			 * park the other processor so that the
+			 * kernel knows where to find them.
+			 */
+			if (residual->MaxNumCpus > 1) {
+				residual->VitalProductData.SmpIar = park_cpus;
+				residual->Cpus[1].CpuState = CPU_GOOD;
+				hold_residual->Cpus[1].CpuState = CPU_GOOD_FW;
+			}
 		}
 		memcpy(hold_residual,residual,sizeof(RESIDUAL));
 	} else {
@@ -465,22 +495,23 @@
 		puts(" ");
 		puthex((unsigned long)zimage_size+(unsigned long)zimage_start);
 		puts("\n");
-	}
 
-	/* relocate initrd */
-	if ( initrd_start )
-	{
+		/* relocate initrd */
+		if ( initrd_start )
+		{
+			puts("initrd at:     "); puthex(initrd_start);
+			puts(" "); puthex(initrd_end); puts("\n");
+			avail_ram = (char *)PAGE_ALIGN(
+				(unsigned long)zimage_size+(unsigned long)zimage_start);
+			memcpy ((void *)avail_ram, (void *)initrd_start, INITRD_SIZE );
+			initrd_start = (unsigned long)avail_ram;
+			initrd_end = initrd_start + INITRD_SIZE;
+			puts("relocated to:  "); puthex(initrd_start);
+			puts(" "); puthex(initrd_end); puts("\n");
+		}
+	} else if ( initrd_start ) {
 		puts("initrd at:     "); puthex(initrd_start);
 		puts(" "); puthex(initrd_end); puts("\n");
-#ifdef OMIT
-		avail_ram = (char *)PAGE_ALIGN(
-			(unsigned long)zimage_size+(unsigned long)zimage_start);
-		memcpy ((void *)avail_ram, (void *)initrd_start, INITRD_SIZE );
-		initrd_start = (unsigned long)avail_ram;
-		initrd_end = initrd_start + INITRD_SIZE;
-		puts("relocated to:  "); puthex(initrd_start);
-		puts(" "); puthex(initrd_end); puts("\n");
-#endif
 	}
 
 	avail_ram = (char *)0x00400000;
arch/ppc/config.in +3 -1
diff -u -r --new-file linux-2.2.10_2/arch/ppc/config.in linux.jp/arch/ppc/config.in
@@ -1,4 +1,4 @@
@@ -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
@@ -146,6 +145,9 @@
   bool 'Network device support' CONFIG_NETDEVICES
   if [ "$CONFIG_NETDEVICES" = "y" ]; then
     source drivers/net/Config.in
+    if [ "$CONFIG_ATM" = "y" ]; then
+      source drivers/atm/Config.in
+    fi
   fi
   endmenu
 fi
arch/ppc/kernel/Makefile +1 -1
diff -u -r --new-file linux-2.2.10_2/arch/ppc/kernel/Makefile linux.jp/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_2/arch/ppc/kernel/irq.c linux.jp/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 +123 -28

194 lines not on this page · raw message

arch/ppc/kernel/prep_setup.c +0 -1
diff -u -r --new-file linux-2.2.10_2/arch/ppc/kernel/prep_setup.c linux.jp/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;
drivers/block/cmd646.c +1 -1
diff -u -r --new-file linux-2.2.10_2/drivers/block/cmd646.c linux.jp/drivers/block/cmd646.c
@@ -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_2/drivers/block/genhd.c linux.jp/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_2/drivers/char/Config.in linux.jp/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_2/drivers/char/keyboard.c linux.jp/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 +1 -0
diff -u -r --new-file linux-2.2.10_2/drivers/char/pc_keyb.c linux.jp/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_2/drivers/char/pc_keyb.h linux.jp/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 +1 -0
diff -u -r --new-file linux-2.2.10_2/drivers/pci/oldproc.c linux.jp/drivers/pci/oldproc.c
@@ -763,6 +764,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_2/include/asm-ppc/io.h linux.jp/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_2/include/linux/pci.h linux.jp/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