Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Conrad Parker <conradp@cse.unsw.edu.au>
To: Jeff Harrell <jharrell@ti.com>, linux@cthulhu.engr.sgi.com
Subject: Re: question concerning serial console setup
Date: Thu, 30 Dec 1999 11:47:36 +1100	[thread overview]
Message-ID: <19991230114736.C18261@cse.unsw.edu.au> (raw)
In-Reply-To: <386A5F9B.50B4AFEF@ti.com>; from Jeff Harrell on Wed, Dec 29, 1999 at 12:23:07PM -0700

On Wed, Dec 29, 1999 at 12:23:07PM -0700, Jeff Harrell wrote:
> I wonder if anybody might have some information concerning the setup of
> a serial console device
> on the MIPS/Linux platform.  I have been looking at the sgi (indy)
> source code to determine how to
> setup a serial console device.  The file arch/mips/sgi/kernel/setup.c
> contains a call to "console_setup"
> passing the parameters "ttys0" and NULL.  I have had some trouble
> locating the routine that this is
> actually calling (file, directory?).  It looks like there is a version
> in printk.c and in one of  the char drivers (serial167.c).
> These do not seem like the correct routines.

the version in serial167.c is commented out and looks like it was once
there only as a placeholder.

console_setup() in printk.c is the correct one, but it doesn't do everything
you want. It simply determines which of the possible consoles is the system
("preferred") console. Normally this is called via parse_options in
init/main.c so you can set it on booting by passing the kernel parameter
console=blah, but it can be called any time before the kernel calls
console_init() (which it does immediately after calling parse_options, in
order to get the console up asap). If you've configured the kernel to run a
serial console, console_init() (which is in drivers/char/tty_io.c) will call
serial_console_init().

For the SGI/MIPS, (the code you're looking at in
arch/mips/sgi/kernel/setup.c) the choice of serial console can be
determined by querying the prom settings, so rather than forcing this to be
a boot parameter the correct console is set up at runtime. (If I'm not
mistaken, this can still be overriden by passing a kernel parameter, as
this bit of setup is called way before init/main.c calls parse_options()).
However, you don't need to call console_setup() in your platform setup
routine -- it's only done here for convenience.

> In our architecture we are
> using the 85C30 (SCC) driver
> (zs.c, zs.h),  can I use the serial_console_init routines from this code
> to accomplish the same thing?  Is
> serial_console setting up additional information that won't get setup
> elsewhere?   Any help would be
> greatly appreciated.
> 

using zs.c and zs.h from where? (ie. your own code, or from somewhere like
drivers/tc?) drivers/sgi/char/sgiserial.c also implements Z8530 support
nicely.

The serial console routines set up linux console functions that happen
to use the serial device; a console is something that basically provides
a write function, possibly a read function, and some other stuff like
special key settings. So, eg. your console write function (like
zs_console_write in sgiserial.c) does a few serial put_chars and so on.

You need to set up a struct console with these fields (as defined in
<linux/console.h>), then make a serial_console_init() function that
calls register_console (defined in printk.c). It'll become the default
system console if it's the first console to be registered (and nothing
then calls console_setup), or if you pass the console=ttyS? parameter to
the kernel.

Conrad.

  reply	other threads:[~1999-12-30  0:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-29 19:23 question concerning serial console setup Jeff Harrell
1999-12-30  0:47 ` Conrad Parker [this message]
2000-01-17  3:41   ` Jeff Harrell
2000-01-17  4:06     ` Ralf Baechle
2000-01-18  1:56       ` Andrew R. Baker
2000-01-18  2:14         ` Ralf Baechle
2000-01-18  2:47           ` Andrew R. Baker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19991230114736.C18261@cse.unsw.edu.au \
    --to=conradp@cse.unsw.edu.au \
    --cc=jharrell@ti.com \
    --cc=linux@cthulhu.engr.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox