Skip to contentSkip to conversation

Removing possible wrong asm/serial.h inclusions

CFT:PATCH Russell King 2 participants 2 messages Aug 30, 2006

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

Maybe this should've gone to linuxppc-dev? Can PPC folk please look at the PPC bits of this patch, and also decide whether the following can also have asm/serial.h removed:

arch/ppc/4xx_io/serial_sicc.c
arch/ppc/boot/simple/mpc52xx_tty.c
arch/ppc/boot/simple/mv64x60_tty.c

Thanks.

----- Forwarded message from Russell King <[email protected]> -----
Date: Mon, 28 Aug 2006 09:52:44 +0100
From: Russell King <[email protected]>
To: [email protected], [email protected],
[email protected], [email protected], [email protected], [email protected]
Subject: [CFT:PATCH] Removing possible wrong asm/serial.h inclusions

asm/serial.h is supposed to contain the definitions for the architecture specific 8250 ports for the 8250 driver. It may also define BASE_BAUD, but this is the base baud for the architecture specific ports _only_.

Therefore, nothing other than the 8250 driver should be including this header file. In order to move towards this goal, here is a patch which removes some of the more obvious incorrect includes of the file.

MIPS and PPC has rather a lot of stuff in asm/serial.h, some of it looks related to non-8250 ports. Hence, it's not trivial to conclude that these includes are indeed unnecessary, so can mips and ppc people please test this patch carefully.

Thanks.

arch/frv/kernel/setup.c +0 -1
@@ -31,7 +31,6 @@
 #include <linux/serial_reg.h>
 
 #include <asm/setup.h>
-#include <asm/serial.h>
 #include <asm/irq.h>
 #include <asm/sections.h>
 #include <asm/pgalloc.h>
arch/ia64/kernel/setup.c +0 -1
@@ -54,7 +54,6 @@
 #include <asm/processor.h>
 #include <asm/sal.h>
 #include <asm/sections.h>
-#include <asm/serial.h>
 #include <asm/setup.h>
 #include <asm/smp.h>
 #include <asm/system.h>
arch/mips/cobalt/setup.c +0 -1
@@ -23,7 +23,6 @@
 #include <asm/processor.h>
 #include <asm/reboot.h>
 #include <asm/gt64120.h>
-#include <asm/serial.h>
 
 #include <asm/mach-cobalt/cobalt.h>
 
arch/mips/lasat/setup.c +0 -1
@@ -34,7 +34,6 @@
 #include <asm/cpu.h>
 #include <asm/bootinfo.h>
 #include <asm/irq.h>
-#include <asm/serial.h>
 #include <asm/lasat/lasat.h>
 #include <asm/lasat/serial.h>
 
arch/powerpc/kernel/setup-common.c +0 -1
@@ -51,7 +51,6 @@
 #include <asm/system.h>
 #include <asm/rtas.h>
 #include <asm/iommu.h>
-#include <asm/serial.h>
 #include <asm/cache.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
arch/powerpc/kernel/setup_32.c +0 -1
@@ -38,7 +38,6 @@
 #include <asm/nvram.h>
 #include <asm/xmon.h>
 #include <asm/time.h>
-#include <asm/serial.h>
 #include <asm/udbg.h>
 
 #include "setup.h"
arch/powerpc/kernel/setup_64.c +0 -1
@@ -51,7 +51,6 @@
 #include <asm/system.h>
 #include <asm/rtas.h>
 #include <asm/iommu.h>
-#include <asm/serial.h>
 #include <asm/cache.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
drivers/char/pcmcia/synclink_cs.c +0 -1
@@ -57,7 +57,6 @@
 #include <linux/netdevice.h>
 #include <linux/vmalloc.h>
 #include <linux/init.h>
-#include <asm/serial.h>
 #include <linux/delay.h>
 #include <linux/ioctl.h>
 
drivers/char/synclink.c +0 -1
@@ -87,7 +87,6 @@
 
 #include <linux/vmalloc.h>
 #include <linux/init.h>
-#include <asm/serial.h>
 
 #include <linux/delay.h>
 #include <linux/ioctl.h>
drivers/serial/m32r_sio.c +2 -3
@@ -76,17 +76,16 @@
  */
 #define is_real_interrupt(irq)	((irq) != 0)
 
-#include <asm/serial.h>
+#define BASE_BAUD	115200
 
 /* Standard COM flags */
 #define STD_COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST)
 
 /*
  * SERIAL_PORT_DFNS tells us about built-in ports that have no
  * standard enumeration mechanism.   Platforms that can find all
  * serial ports via mechanisms like ACPI or PCI need not supply it.
  */
-#undef SERIAL_PORT_DFNS
 #if defined(CONFIG_PLAT_USRV)
 
 #define SERIAL_PORT_DFNS						\
@@ -109,7 +108,7 @@
 #endif /* !CONFIG_PLAT_USRV */
 
 static struct old_serial_port old_serial_port[] = {
-	SERIAL_PORT_DFNS	/* defined in asm/serial.h */
+	SERIAL_PORT_DFNS
 };
 
 #define UART_NR	ARRAY_SIZE(old_serial_port)
Signature · 13 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

----- End forwarded message -----

-- 
Russell King
#1 lore raw
Quoted 7 lines · Russell King

Maybe this should've gone to linuxppc-dev? Can PPC folk please look at the PPC bits of this patch, and also decide whether the following can also have asm/serial.h removed:

arch/ppc/4xx_io/serial_sicc.c
arch/ppc/boot/simple/mpc52xx_tty.c
arch/ppc/boot/simple/mv64x60_tty.c

The situation is that arch/ppc is the old world. Platforms are being moved over to arch/powerpc as fast as we can manage, where things will be much cleaner because the information about type and location of serial ports (among other things) will be supplied via a device tree rather than hardcoded in header files. This means, though, that there isn't much motivation for cleaning up stuff in arch/ppc.

The two users in arch/ppc/boot aren't really part of the kernel proper. The compressed image bootwrapper uses definitions from serial.h on some platforms to access a serial port for interaction with the user. It may be possible to replicate the string of #ifdefs and #includes from serial.h in those files. Tom Rini can best advise about that.

The serial_sicc.c code looks like it should be converted to use the serial_core stuff. I hope that will get done in the process of moving 4xx over to arch/powerpc.

Paul.