[parisc-linux-cvs] linux tsbogend

Thomas Bogendoerfer tsbogend@alpha.franken.de
Fri, 22 Feb 2002 23:58:17 +0100


On Fri, Feb 22, 2002 at 03:48:40PM -0700, Thomas Bogendoerfer wrote:
> CVSROOT:	/var/cvs
> Module name:	linux
> Changes by:	tsbogend	02/02/22 15:48:40
> 
> Modified files:
> 	.              : Makefile 
> 
> Log message:
> 2.4.17-pa29:
> made booting from graphic console with usb keyboard working on B2600
> (should solve same problem on C3K)


Index: arch/parisc/kernel/firmware.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/firmware.c,v
retrieving revision 1.40
diff -u -p -r1.40 firmware.c
--- arch/parisc/kernel/firmware.c	2002/01/30 08:14:47	1.40
+++ arch/parisc/kernel/firmware.c	2002/02/22 22:37:03
@@ -730,6 +730,21 @@ void pdc_soft_power_shutdown(void)
 	spin_unlock_irq(&pdc_lock);
 }
 
+/*
+ * pdc_suspend_usb - Stop USB controller
+ *
+ * If PDC used the usb controller, the usb controller
+ * is still running and will crash the machines during iommu 
+ * setup, because of still running DMA. This PDC call
+ * stops the USB controller
+ */
+void pdc_suspend_usb(void)
+{
+	spin_lock_irq(&pdc_lock);  
+	mem_pdc_call(PDC_IO, PDC_IO_SUSPEND_USB, 0);
+	spin_unlock_irq(&pdc_lock);
+}
+
 /**
  * pdc_iodc_putc - Console character print using IODC.
  * @c: the character to output.
Index: arch/parisc/kernel/inventory.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/inventory.c,v
retrieving revision 1.45
diff -u -p -r1.45 inventory.c
--- arch/parisc/kernel/inventory.c	2001/10/29 17:53:16	1.45
+++ arch/parisc/kernel/inventory.c	2002/02/22 21:55:58
@@ -524,6 +524,12 @@ static void __init system_map_inventory(
 {
 	int i;
 	long status = PDC_OK;
+    
+	/*
+	 * first stop the usb controller, otherwise the machine
+	 * might crash during iommu setup
+	 */
+	pdc_suspend_usb();
 
 	for (i = 0; status != PDC_BAD_PROC && status != PDC_NE_MOD; i++) {
 		struct parisc_device *dev;
Index: drivers/usb/usb-ohci.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/usb/usb-ohci.c,v
retrieving revision 1.16
diff -u -p -r1.16 usb-ohci.c
--- drivers/usb/usb-ohci.c	2002/02/15 22:31:43	1.16
+++ drivers/usb/usb-ohci.c	2002/02/22 21:51:33
@@ -2139,6 +2139,7 @@ static int hc_reset (ohci_t * ohci)
 	int timeout = 30;
 	int smm_timeout = 50; /* 0,5 sec */
 	 	
+#ifndef CONFIG_SUPERIO /* PA-RISC doesn't have SMM, but PDC might leave IR set */
 	if (readl (&ohci->regs->control) & OHCI_CTRL_IR) { /* SMM owns the HC */
 		writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
 		dbg("USB HC TakeOver from SMM");
@@ -2149,7 +2150,8 @@ static int hc_reset (ohci_t * ohci)
 				return -1;
 			}
 		}
-	}	
+	}
+#endif	
 		
 	/* Disable HC interrupts */
 	writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
Index: include/asm-parisc/pdc.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/pdc.h,v
retrieving revision 1.42
diff -u -p -r1.42 pdc.h
--- include/asm-parisc/pdc.h	2002/02/18 20:51:26	1.42
+++ include/asm-parisc/pdc.h	2002/02/22 21:57:26
@@ -946,6 +946,7 @@ int pdc_do_firm_test_reset(unsigned long
 int pdc_do_reset(void);
 int pdc_soft_power_info(unsigned long *power_reg);
 void pdc_soft_power_shutdown(void);
+void pdc_suspend_usb(void);
 int pdc_iodc_getc(void);
 void pdc_iodc_putc(unsigned char c);
 void pdc_iodc_outc(unsigned char c);

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                 [ Alexander Viro on linux-kernel ]