Linux MIPS Architecture development
 help / color / mirror / Atom feed
* RFC: run-time defining serial ports
@ 2001-07-13  0:50 Jun Sun
  2001-07-13 11:43 ` Ralf Baechle
  2001-07-13 14:20 ` Marc Karasek
  0 siblings, 2 replies; 4+ messages in thread
From: Jun Sun @ 2001-07-13  0:50 UTC (permalink / raw)
  To: linux-mips


As more and more boards are added to Linux-mips tree, many places are getting
crowdier and uglier, including serial.h.  The same thing is true for PPC and
other architectures.

It turns out an easy solution is to let every board sets the serial port
definitions at run-time through calling early_serial_setup() routine.

An easy fix for now is to give a default table size when no serial definition
is given, which at least reserves some slots in the rs_table array.  See the
patch below.

A better solution is probably to provide a config option to define the serial
table size.

A by-product of this arrangement is that you can configure a kernel for
multiple machines.

What do you think?

Jun

diff -Nru include/asm-mips/serial.h.orig include/asm-mips/serial.h
--- include/asm-mips/serial.h.orig      Wed May 16 15:58:29 2001
+++ include/asm-mips/serial.h   Thu Jul 12 17:06:05 2001
@@ -271,3 +271,6 @@
        AU1000_SERIAL_PORT_DEFNS        \
        DDB5477_SERIAL_PORT_DEFNS
 
+#ifnef SERIAL_PORT_DFNS
+#define RS_TABLE_SIZE          4
+#endif

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: RFC: run-time defining serial ports
  2001-07-13  0:50 RFC: run-time defining serial ports Jun Sun
@ 2001-07-13 11:43 ` Ralf Baechle
  2001-07-13 14:20 ` Marc Karasek
  1 sibling, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2001-07-13 11:43 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips

On Thu, Jul 12, 2001 at 05:50:33PM -0700, Jun Sun wrote:

> As more and more boards are added to Linux-mips tree, many places are getting
> crowdier and uglier, including serial.h.  The same thing is true for PPC and
> other architectures.
> 
> It turns out an easy solution is to let every board sets the serial port
> definitions at run-time through calling early_serial_setup() routine.
> 
> An easy fix for now is to give a default table size when no serial definition
> is given, which at least reserves some slots in the rs_table array.  See the
> patch below.
> 
> A better solution is probably to provide a config option to define the serial
> table size.

It's needed; I have machines here with upto 11 serial interfaces on a lowly
R4700 box; Origins may have _many_ more.

> A by-product of this arrangement is that you can configure a kernel for
> multiple machines.
> 
> What do you think?

  Ralf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: RFC: run-time defining serial ports
  2001-07-13  0:50 RFC: run-time defining serial ports Jun Sun
  2001-07-13 11:43 ` Ralf Baechle
@ 2001-07-13 14:20 ` Marc Karasek
  2001-07-13 14:48   ` Gleb O. Raiko
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Karasek @ 2001-07-13 14:20 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips

Good idea, I would take it a step further coming at it from a purely
embedded standpoint.  If a option to the kernel could be defined so that
the init code that brings the system up could setup things like the
serial port, etc. and then notify the kernel that the serial port has
been setup with parameters xyz.  All boot monitors (YAMON, PMON,
REDBOOT) initialize the serial port as part of there bootup for use as a
debug monitor, etc.  Why should we have to redo something that is
already taken care of.  Unless there is some case where you want to
reset it, maybe the baud rate is too slow or something.  

I think as linux moves more into the embedded space we will need to deal
with more issues like this.  Where the embedded requirements do not
match with those coming from the desktop/workstation world.  


On 12 Jul 2001 17:50:33 -0700, Jun Sun wrote:
> 
> As more and more boards are added to Linux-mips tree, many places are getting
> crowdier and uglier, including serial.h.  The same thing is true for PPC and
> other architectures.
> 
> It turns out an easy solution is to let every board sets the serial port
> definitions at run-time through calling early_serial_setup() routine.
> 
> An easy fix for now is to give a default table size when no serial definition
> is given, which at least reserves some slots in the rs_table array.  See the
> patch below.
> 
> A better solution is probably to provide a config option to define the serial
> table size.
> 
> A by-product of this arrangement is that you can configure a kernel for
> multiple machines.
> 
> What do you think?
> 
> Jun
> 
> diff -Nru include/asm-mips/serial.h.orig include/asm-mips/serial.h
> --- include/asm-mips/serial.h.orig      Wed May 16 15:58:29 2001
> +++ include/asm-mips/serial.h   Thu Jul 12 17:06:05 2001
> @@ -271,3 +271,6 @@
>         AU1000_SERIAL_PORT_DEFNS        \
>         DDB5477_SERIAL_PORT_DEFNS
>  
> +#ifnef SERIAL_PORT_DFNS
> +#define RS_TABLE_SIZE          4
> +#endif
--
/*************************
Marc Karasek
Sr. Firmware Engineer
iVivity Inc.
marc_karasek@ivivity.com
(770) 986-8925
(770) 986-8926 Fax
*************************/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: RFC: run-time defining serial ports
  2001-07-13 14:20 ` Marc Karasek
@ 2001-07-13 14:48   ` Gleb O. Raiko
  0 siblings, 0 replies; 4+ messages in thread
From: Gleb O. Raiko @ 2001-07-13 14:48 UTC (permalink / raw)
  To: Marc Karasek; +Cc: Jun Sun, linux-mips

Marc Karasek wrote:
> 
> All boot monitors (YAMON, PMON,
> REDBOOT) initialize the serial port as part of there bootup for use as a
> debug monitor, etc.  Why should we have to redo something that is
> already taken care of.

Because we've got completely another policy of handling a device. For
example, a boot monitor (good one) must implement polling technique
only, Linux uses interrupt-driven technique (well, mostly). In general
case, Linux has to reinitialize a device after a boot monitor. It's
clear.

Regards,
Gleb.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-07-13 14:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-13  0:50 RFC: run-time defining serial ports Jun Sun
2001-07-13 11:43 ` Ralf Baechle
2001-07-13 14:20 ` Marc Karasek
2001-07-13 14:48   ` Gleb O. Raiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox