* MPC8xx: Using SCM/SCC and standard 16C550 Uarts together...
@ 2005-01-12 9:51 David Jander
0 siblings, 0 replies; 5+ messages in thread
From: David Jander @ 2005-01-12 9:51 UTC (permalink / raw)
To: linuxppc-embedded
Hi all,
The situation is:
Our custom board needs to use SCM1 as console, and has an external quad uart
chip (16C554) connected to the external bus, mapped at 0xf8100000.
I am using the ppclinux_2_4_devel tree from Denx.
I ioremapped that address space, and it seems to work. Right now I don't have
the daughterboard with the quad-uarts working (as in hardware), so I can't
fully test that.
The problem is:
Apparently arch/ppc/8xx_io/uart.c doesn't take into account other serial
drivers that may initialize later, and uses a serial_state struct statically.
Shouldn't this be visible to the outside? Shouldn't there be a global
serial_state structure somewhere that lists all serial ports?
Right now, I get this:
-----------------------------------
...
CPM UART driver version 0.04
ttyS0 at 0x0280 is on SMC1 using BRG1
ttyS1 at 0x0200 is on SCC3 using BRG2
ttyS2 at 0x0300 is on SCC4 using BRG3
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ enabled
...
VFS: Mounted root (jffs2 filesystem).
Mounted devfs on /dev
Freeing unused kernel memory: 56k init
------------------------------------
And then nothing more. I assume, at that point init opens /dev/console (ttyS0)
and that device doesn't exist, since drivers/char/serial.c doesn't detect any
uart at the moment.
If it did, maybe I would get console stuff out of the first 16c554 port.
Has anybody else tried this?
What would be the right way to fix this?
Greetings,
--
David Jander
Protonic Holland.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: MPC8xx: Using SCM/SCC and standard 16C550 Uarts together...
@ 2005-01-12 9:59 Demke Torsten-atd012
2005-01-12 11:55 ` David Jander
0 siblings, 1 reply; 5+ messages in thread
From: Demke Torsten-atd012 @ 2005-01-12 9:59 UTC (permalink / raw)
To: David Jander, linuxppc-embedded
Hi David,
I dont know exactly the state of the DENX kernel, but in the standard
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.
Regards,
Torsten
> -----Original Message-----
> From: linuxppc-embedded-bounces@ozlabs.org
> [mailto:linuxppc-embedded-bounces@ozlabs.org]On Behalf Of David Jander
> Sent: Mittwoch, 12. Januar 2005 10:52
> To: linuxppc-embedded@ozlabs.org
> Subject: MPC8xx: Using SCM/SCC and standard 16C550 Uarts together...
>
>
>
> Hi all,
>
> The situation is:
> Our custom board needs to use SCM1 as console, and has an
> external quad uart
> chip (16C554) connected to the external bus, mapped at 0xf8100000.
> I am using the ppclinux_2_4_devel tree from Denx.
> I ioremapped that address space, and it seems to work. Right
> now I don't have
> the daughterboard with the quad-uarts working (as in
> hardware), so I can't
> fully test that.
>
> The problem is:
> Apparently arch/ppc/8xx_io/uart.c doesn't take into account
> other serial
> drivers that may initialize later, and uses a serial_state
> struct statically.
> Shouldn't this be visible to the outside? Shouldn't there be a global
> serial_state structure somewhere that lists all serial ports?
> Right now, I get this:
>
> -----------------------------------
> ...
> CPM UART driver version 0.04
> ttyS0 at 0x0280 is on SMC1 using BRG1
> ttyS1 at 0x0200 is on SCC3 using BRG2
> ttyS2 at 0x0300 is on SCC4 using BRG3
> pty: 256 Unix98 ptys configured
> Serial driver version 5.05c (2001-07-08) with MANY_PORTS
> SHARE_IRQ enabled
> ...
> VFS: Mounted root (jffs2 filesystem).
> Mounted devfs on /dev
> Freeing unused kernel memory: 56k init
> ------------------------------------
>
> And then nothing more. I assume, at that point init opens
> /dev/console (ttyS0)
> and that device doesn't exist, since drivers/char/serial.c
> doesn't detect any
> uart at the moment.
> If it did, maybe I would get console stuff out of the first
> 16c554 port.
>
> Has anybody else tried this?
> What would be the right way to fix this?
>
> Greetings,
>
> --
> David Jander
> Protonic Holland.
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPC8xx: Using SCM/SCC and standard 16C550 Uarts together...
2005-01-12 9:59 Demke Torsten-atd012
@ 2005-01-12 11:55 ` David Jander
2005-01-12 12:18 ` Yuli Barcohen
0 siblings, 1 reply; 5+ messages in thread
From: David Jander @ 2005-01-12 11:55 UTC (permalink / raw)
To: linuxppc-embedded
On Wednesday 12 January 2005 10:59, Demke Torsten-atd012 wrote:
> I dont know exactly the state of the DENX kernel, but in the standard
> 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?
Greetings,
--
David Jander
Protonic Holland.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MPC8xx: Using SCM/SCC and standard 16C550 Uarts together...
2005-01-12 11:55 ` David Jander
@ 2005-01-12 12:18 ` Yuli Barcohen
0 siblings, 0 replies; 5+ messages in thread
From: Yuli Barcohen @ 2005-01-12 12:18 UTC (permalink / raw)
To: David Jander; +Cc: linuxppc-embedded
>>>>> David Jander writes:
David> On Wednesday 12 January 2005 10:59, Demke Torsten-atd012
David> wrote:
Demke> I dont know exactly the state of the DENX kernel, but in the
Demke> standard kernel the 8xx UART driver and the 16550 driver are
Demke> using the same device numbers (TTY_MAJOR) and device names
Demke> (/dev/ttySx). You have to change one of them.
David> You are right! What now? I cannot go around and change
David> TTY_MAJOR! Is it true then, that you normally cannot have a
David> mix of non-16550 uarts and 16550 uarts on the same system,
David> without doing nonstandard things with major numbers?
We've got such a mix but we use completely different MPC8xx support
infrastructure. Our SCC/SMC UART driver takes care of possible external
UARTs (it uses the same major number but configurable minor).
David> Should maybe arch/ppc/8xx_io/uart.c use another major number?
Then you'll have to change all applications using standard device names
(ttySx).
--
========================================================================
Yuli Barcohen | Phone +972-9-765-1788 | Software Project Leader
yuli@arabellasw.com | Fax +972-9-765-7494 | Arabella Software, Israel
========================================================================
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: MPC8xx: Using SCM/SCC and standard 16C550 Uarts together...
@ 2005-01-12 14:46 Demke Torsten-atd012
0 siblings, 0 replies; 5+ messages in thread
From: Demke Torsten-atd012 @ 2005-01-12 14:46 UTC (permalink / raw)
To: David Jander, linuxppc-embedded
Hello David,
>
> On Wednesday 12 January 2005 10:59, Demke Torsten-atd012 wrote:
> > I dont know exactly the state of the DENX kernel, but in
> the standard
> > 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-01-12 14:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-12 9:51 MPC8xx: Using SCM/SCC and standard 16C550 Uarts together David Jander
-- strict thread matches above, loose matches on Subject: below --
2005-01-12 9:59 Demke Torsten-atd012
2005-01-12 11:55 ` David Jander
2005-01-12 12:18 ` Yuli Barcohen
2005-01-12 14:46 Demke Torsten-atd012
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).