Skip to contentSkip to conversation

Simultaneous support for HCDP and SPCR/DBGP defined ports,

PATCH New Khalid Aziz 1 participant 1 message Jul 23, 2002 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Simultaneous support for HCDP and SPCR/DBGP defined ports,

I am attaching a patch which allows a kernel to be built with support for HCDP as well as SPCR/DBGP defined ports with no conflict on machines that support HCDP as well as SPCR/DBGP tables. HCDP table takes precedence over SPCR/DBGP in this patch. So if the kernel finds HCDP table on a machine, it will ignore the SPCR table if there is one. Also, the current HCDP code renames the serial console port defined by HCDP to always be ttyS0 while SPCR code uses ttyS4 for the console port. This patch adds code to drivers/char/acpi_serial.c to rename the console port to be ttyS0.

Signature · 6 lines
Khalid

====================================================================
Khalid Aziz                                   Linux Systems Division
(970)898-9214                                        Hewlett-Packard
[email protected]                                    Fort Collins, CO
arch/ia64/kernel/acpi.c +11 -0
diff -urN --exclude-from=diff_exclude_file linux-2.4.18-ia64/arch/ia64/kernel/acpi.c linux-2.4.18-ia64-hcdp/arch/ia64/kernel/acpi.c
@@ -487,6 +487,17 @@
 	acpi_ser_t *spcr = NULL;
 	unsigned long global_int = 0;
 
+#ifdef CONFIG_SERIAL_HCDP
+	/*
+	 * If an HCDP defined serial console has already been found 
+	 * and initialized, we will ignore SPCR.
+	 */
+	extern int hcdp_initialized;
+
+	if (hcdp_initialized) 
+		return 0;
+#endif
+
 	if (!phys_addr || !size)
 		return -EINVAL;
 
arch/ia64/kernel/setup.c +4 -4
diff -urN --exclude-from=diff_exclude_file linux-2.4.18-ia64/arch/ia64/kernel/setup.c linux-2.4.18-ia64-hcdp/arch/ia64/kernel/setup.c
@@ -342,16 +342,16 @@
 
 	cpu_init();	/* initialize the bootstrap CPU */
 
-#ifdef CONFIG_ACPI_BOOT
-	acpi_boot_init(*cmdline_p);
-#endif
-#ifdef CONFIG_SERIAL_HCDP
+#ifdef CONFIG_SERIAL_HCDP)
 	if (efi.hcdp) {
 		void setup_serial_hcdp(void *);
 
 		/* Setup the serial ports described by HCDP */
 		setup_serial_hcdp(efi.hcdp);
 	}
+#endif
+#ifdef CONFIG_ACPI_BOOT
+	acpi_boot_init(*cmdline_p);
 #endif
 #ifdef CONFIG_VT
 # if defined(CONFIG_DUMMY_CONSOLE)
drivers/char/Config.in +4 -4
diff -urN --exclude-from=diff_exclude_file linux-2.4.18-ia64/drivers/char/Config.in linux-2.4.18-ia64-hcdp/drivers/char/Config.in
@@ -12,7 +12,10 @@
 if [ "$CONFIG_SERIAL" = "y" ]; then
    bool '  Support for console on serial port' CONFIG_SERIAL_CONSOLE
    if [ "$CONFIG_IA64" = "y" ]; then
-      bool 'Support for serial console port described by EFI HCDP table' CONFIG_SERIAL_HCDP
+      bool '  Support for serial console port described by EFI HCDP table' CONFIG_SERIAL_HCDP
+   fi
+   if [ "$CONFIG_ACPI" = "y" ]; then
+      bool '  Support for serial ports defined by ACPI tables' CONFIG_SERIAL_ACPI
    fi
    if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
       tristate '   Atomwide serial port support' CONFIG_ATOMWIDE_SERIAL
@@ -20,9 +23,6 @@
    fi
 fi
 dep_mbool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED $CONFIG_SERIAL
-if [ "$CONFIG_ACPI" = "y" ]; then
-   bool '  Support for serial ports defined by ACPI tables' CONFIG_SERIAL_ACPI
-fi
 if [ "$CONFIG_SERIAL_EXTENDED" = "y" ]; then
    bool '  Support more than 4 serial ports' CONFIG_SERIAL_MANY_PORTS
    bool '  Support for sharing serial interrupts' CONFIG_SERIAL_SHARE_IRQ
drivers/char/acpi_serial.c +51 -9

90 lines not on this page · raw message

drivers/char/hcdp_serial.c +6 -3
diff -urN --exclude-from=diff_exclude_file linux-2.4.18-ia64/drivers/char/hcdp_serial.c linux-2.4.18-ia64-hcdp/drivers/char/hcdp_serial.c
@@ -25,6 +25,8 @@
 extern struct serial_state rs_table[];
 extern int serial_nr_ports;
 
+int hcdp_initialized = 0;
+
 /*
  * Parse the HCDP table to find descriptions for headless console and 
  * debug serial ports and add them to rs_table[]. A pointer to HCDP
@@ -207,9 +209,10 @@
 			printk("setup_serial_hcdp(): early_serial_setup() for HCDP serial console port failed. Will try any additional consoles in HCDP.\n");
 			continue;
 		}
-		else
-			if (hcdp_dev->type == HCDP_DEV_CONSOLE)
-				break;
+		else {
+			hcdp_initialized = 1;
+			break;
+		}
 #ifdef SERIAL_DEBUG_HCDP
 		printk("\n");
 #endif