patch-2.4.23 linux-2.4.23/arch/i386/kernel/acpi.c

Next file: linux-2.4.23/arch/i386/kernel/acpitable.c
Previous file: linux-2.4.23/arch/i386/kernel/Makefile
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/arch/i386/kernel/acpi.c linux-2.4.23/arch/i386/kernel/acpi.c
@@ -57,8 +57,8 @@
    -------------------------------------------------------------------------- */
 
 #ifdef CONFIG_ACPI_BOOT
-extern int acpi_disabled;
-extern int acpi_ht;
+int acpi_noirq __initdata = 0;  /* skip ACPI IRQ initialization */
+int acpi_ht __initdata = 1;     /* enable HT */
 
 enum acpi_irq_model_id		acpi_irq_model;
 
@@ -355,7 +355,6 @@
 
 	result = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
 	if (!result) {
-		printk(KERN_WARNING PREFIX "MADT not present\n");
 		return 0;
 	}
 	else if (result < 0) {
@@ -416,7 +415,7 @@
 	 * If MPS is present, it will handle them,
 	 * otherwise the system will stay in PIC mode
 	 */
-	if (acpi_disabled) {
+	if (acpi_disabled || acpi_noirq) {
 		return 1;
 	}
 
@@ -459,6 +458,8 @@
 
 	acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
 
+	acpi_irq_balance_set(NULL);
+
 	acpi_ioapic = 1;
 
 	if (acpi_lapic && acpi_ioapic)
@@ -471,6 +472,71 @@
 
 #endif /*CONFIG_ACPI_BOOT*/
 
+#ifdef	CONFIG_ACPI_BUS
+/*
+ * "acpi_pic_sci=level" (current default)
+ * programs the PIC-mode SCI to Level Trigger.
+ * (NO-OP if the BIOS set Level Trigger already)
+ *
+ * If a PIC-mode SCI is not recogznied or gives spurious IRQ7's
+ * it may require Edge Trigger -- use "acpi_pic_sci=edge"
+ * (NO-OP if the BIOS set Edge Trigger already)
+ *
+ * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
+ * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
+ * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
+ * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
+ */
+
+static __initdata int	acpi_pic_sci_trigger;	/* 0: level, 1: edge */
+
+void __init
+acpi_pic_sci_set_trigger(unsigned int irq)
+{
+	unsigned char mask = 1 << (irq & 7);
+	unsigned int port = 0x4d0 + (irq >> 3);
+	unsigned char val = inb(port);
+
+	
+	printk(PREFIX "IRQ%d SCI:", irq);
+	if (!(val & mask)) {
+		printk(" Edge");
+
+		if (!acpi_pic_sci_trigger) {
+			printk(" set to Level");
+			outb(val | mask, port);
+		}
+	} else {
+		printk(" Level");
+
+		if (acpi_pic_sci_trigger) {
+			printk(" set to Edge");
+			outb(val | mask, port);
+		}
+	}
+	printk(" Trigger.\n");
+}
+
+int __init
+acpi_pic_sci_setup(char *str)
+{
+	while (str && *str) {
+		if (strncmp(str, "level", 5) == 0)
+			acpi_pic_sci_trigger = 0;	/* force level trigger */
+		if (strncmp(str, "edge", 4) == 0)
+			acpi_pic_sci_trigger = 1;	/* force edge trigger */
+		str = strchr(str, ',');
+		if (str)
+			str += strspn(str, ", \t");
+	}
+	return 1;
+}
+
+__setup("acpi_pic_sci=", acpi_pic_sci_setup);
+
+#endif /* CONFIG_ACPI_BUS */
+
+
 
 /* --------------------------------------------------------------------------
                               Low-Level Sleep Support

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