patch-2.4.22 linux-2.4.22/arch/alpha/kernel/sys_sio.c

Next file: linux-2.4.22/arch/alpha/lib/ev6-stxncpy.S
Previous file: linux-2.4.22/arch/alpha/kernel/sys_sable.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/arch/alpha/kernel/sys_sio.c linux-2.4.22/arch/alpha/kernel/sys_sio.c
@@ -35,6 +35,14 @@
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
+#ifdef ALPHA_RESTORE_SRM_SETUP
+/* Save LCA configuration data as the console had it set up.  */
+struct 
+{
+	unsigned int orig_route_tab; /* for SAVE/RESTORE */
+} saved_config __attribute((common));
+#endif
+
 
 static void __init
 sio_init_irq(void)
@@ -76,6 +84,15 @@
 static void __init
 sio_pci_route(void)
 {
+#ifdef ALPHA_RESTORE_SRM_SETUP
+	/* First, read and save the original setting. */
+	pcibios_read_config_dword(0, PCI_DEVFN(7, 0), 0x60,
+				  &saved_config.orig_route_tab);
+	printk("%s: PIRQ original 0x%x new 0x%x\n", __FUNCTION__,
+	       saved_config.orig_route_tab, alpha_mv.sys.sio.route_tab);
+#endif
+
+	/* Now override with desired setting. */
 	pcibios_write_config_dword(0, PCI_DEVFN(7, 0), 0x60,
 				   alpha_mv.sys.sio.route_tab);
 }
@@ -244,6 +261,21 @@
 	outb(0x0f, 0x3ce); outb(orig, 0x3cf); /* (re)lock PR0-4 */
 }
 
+void
+sio_kill_arch(int mode)
+{
+#ifdef ALPHA_RESTORE_SRM_SETUP
+	/* Since we cannot read the PCI DMA Window CSRs, we
+	 * cannot restore them here.
+	 *
+	 * However, we CAN read the PIRQ route register, so restore it
+	 * now...
+	 */
+	pcibios_write_config_dword(0, PCI_DEVFN(7, 0), 0x60,
+                                  saved_config.orig_route_tab);
+#endif
+}
+
 
 /*
  * The System Vectors
@@ -268,7 +300,7 @@
 	init_irq:		sio_init_irq,
 	init_rtc:		common_init_rtc,
 	init_pci:		alphabook1_init_pci,
-	kill_arch:		NULL,
+	kill_arch:		sio_kill_arch,
 	pci_map_irq:		noname_map_irq,
 	pci_swizzle:		common_swizzle,
 
@@ -299,6 +331,7 @@
 	init_irq:		sio_init_irq,
 	init_rtc:		common_init_rtc,
 	init_pci:		noname_init_pci,
+	kill_arch:		sio_kill_arch,
 	pci_map_irq:		noname_map_irq,
 	pci_swizzle:		common_swizzle,
 
@@ -328,6 +361,7 @@
 	init_irq:		sio_init_irq,
 	init_rtc:		common_init_rtc,
 	init_pci:		noname_init_pci,
+	kill_arch:		sio_kill_arch,
 	pci_map_irq:		noname_map_irq,
 	pci_swizzle:		common_swizzle,
 
@@ -366,6 +400,7 @@
 	init_irq:		sio_init_irq,
 	init_rtc:		common_init_rtc,
 	init_pci:		noname_init_pci,
+	kill_arch:		sio_kill_arch,
 	pci_map_irq:		p2k_map_irq,
 	pci_swizzle:		common_swizzle,
 
@@ -395,6 +430,7 @@
 	init_irq:		sio_init_irq,
 	init_rtc:		common_init_rtc,
 	init_pci:		noname_init_pci,
+	kill_arch:		sio_kill_arch,
 	pci_map_irq:		noname_map_irq,
 	pci_swizzle:		common_swizzle,
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)