RE: MPC8xx: Using SCM/SCC and standard 16C550 Uarts together...

From: Demke Torsten-atd012 <hidden>
Date: 2005-01-12 14:47:11

Hello David,
On Wednesday 12 January 2005 10:59, Demke Torsten-atd012 wrote:
quoted
I dont know exactly the state of the DENX kernel, but in 
the standard
quoted
kernel the 8xx UART driver and the 16550 driver are using the same
device numbers (TTY_MAJOR) and device names (/dev/ttySx).
You have to change one of them.
You are right! What now? I cannot go around and change TTY_MAJOR!
Is it true then, that you normally cannot have a mix of 
non-16550 uarts and 
16550 uarts on the same system, without doing nonstandard 
things with major 
numbers?
Should maybe arch/ppc/8xx_io/uart.c use another major number?
Yes, indeed I changed the major device number and the name in 
8xx_io/uart.c. I used the same numbers and names that are used
in the 2.6 kernel (TTY_CPM_MAJOR=42, name= "ttyCPM"). Of course
you have to change all applications that use the 8xx UART then.

See pseudo-patch:

+#ifdef CONFIG_SERIAL_CONSOLE
 static struct console sercons = {
-	name:		"ttyS",
+	name:		"ttyCPM",
 	write:		serial_console_write,
 	device:		serial_console_device,
 	setup:		serial_console_setup,
 	flags:		CON_PRINTBUFFER,
 	index:		CONFIG_SERIAL_CONSOLE_PORT,
 };
+#endif

...

 static kdev_t serial_console_device(struct console *c)
 {
+#ifdef CONFIG_SERIAL
+	return MKDEV(TTY_CPM_MAJOR, 42 + c->index);
+#else
 	return MKDEV(TTY_MAJOR, 64 + c->index);
+#endif
 }

...

 	serial_driver.magic = TTY_DRIVER_MAGIC;
 	serial_driver.driver_name = "serial";
+#ifdef CONFIG_SERIAL
+/* use different numbers if "standard" serial driver is enabled */
+	serial_driver.driver_name = "serialCPM";
+#ifdef CONFIG_DEVFS_FS
+	serial_driver.name = "tts/%d";
+#else
+	serial_driver.name = "ttyCPM";
+#endif
+	serial_driver.major = TTY_CPM_MAJOR;
+	serial_driver.minor_start = 42;
+#else
+	serial_driver.driver_name = "serial";
 #ifdef CONFIG_DEVFS_FS
 	serial_driver.name = "tts/%d";
 #else
@@ -2553,6 +2585,7 @@ int __init rs_8xx_init(void)
 #endif
 	serial_driver.major = TTY_MAJOR;
 	serial_driver.minor_start = 64;
+#endif /* CONFIG_SERIAL */
 	serial_driver.num = NR_PORTS;
 	serial_driver.type = TTY_DRIVER_TYPE_SERIAL;
 	serial_driver.subtype = SERIAL_TYPE_NORMAL;
Greetings,
Torsten
Greetings,

-- 
David Jander
Protonic Holland.
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help