All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Rowand <frank_rowand@mvista.com>
To: linuxppc-dev@lists.linuxppc.org
Cc: Adrian Cox <adrian@humboldt.co.uk>, paulus@samba.org
Subject: Re: include/asm-ppc/platforms/
Date: Thu, 29 Nov 2001 09:57:02 -0800	[thread overview]
Message-ID: <3C0676EE.BAE43398@mvista.com> (raw)
In-Reply-To: 3C055B2E.9020801@humboldt.co.uk

[-- Attachment #1: Type: text/plain, Size: 1284 bytes --]

Adrian Cox wrote:
>
> Paul Mackerras wrote:
>
> > Perfectly reasonable - I wish all the platforms used early_serial_setup.
> > Would you mind posting your code that does the early_serial_setup calls?
>
> Mangled by Mozilla below. This is a 7400 board with a memory mapped
> uart. It is important to zero out the entries for serial ports that
> aren't present, otherwise the serial driver will attempt to use the
> traditional locations.
>
> static void __init
> tpe3_setup_arch(void)
> {
>         struct serial_struct req;
>
>         ...
>
>         memset(&req, 0, sizeof (req));
>         req.line = 0;
>         req.io_type = SERIAL_IO_MEM;
>         req.iomem_base = (void *) (tpe3_uart_base + 0x10);
>         req.baud_base = 6144000 / 16;
>         req.irq = 3;
>         req.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
>         early_serial_setup(&req);
>         memset(&req, 0, sizeof (req));
>         req.line = 1;
>         early_serial_setup(&req);
>         req.line = 2;
>         early_serial_setup(&req);
>         req.line = 3;
>         early_serial_setup(&req);
>
>         ...
> }


And a more generic approach (that can pull the port definitions from
a header file) is attached...


-Frank
--
Frank Rowand <frank_rowand@mvista.com>
MontaVista Software, Inc

[-- Attachment #2: example --]
[-- Type: text/plain, Size: 1908 bytes --]

Date: Wed, 27 Jun 2001 17:55:06 -0700
From: Frank Rowand <frank_rowand@mvista.com>
Reply-To: frowand@mvista.com
Subject: Paulus, Trini: here's how to dynamically register serial port

You guys were discussing how to get rid of all the #ifdef ... includes for
the serial ports, and wondering how to dynamically register ports.  The
interface the serial driver provides for this is early_serial_setup().
Here's an example of using it (this example uses the SERIAL_PORT_DFNS from
ppc4xx_serial.h just because it was already defined there):


        {
#include <linux/serialP.h>

                int k;
                struct serial_struct req;
                struct serial_state tmp_rs_table[RS_TABLE_SIZE] = {
                        SERIAL_PORT_DFNS   /* Defined in ppc4xx_serial.h */
                };

                for (k = 0; k < RS_TABLE_SIZE; k++) {
                        if (tmp_rs_table[k].iomem_base != 0) {

        req.baud_base       = tmp_rs_table[k].baud_base;
        req.port            = tmp_rs_table[k].port;
        req.port_high       = 0;
        req.irq             = tmp_rs_table[k].irq;
        req.flags           = tmp_rs_table[k].flags;
        req.close_delay     = tmp_rs_table[k].close_delay;
        req.io_type         = tmp_rs_table[k].io_type;
        req.hub6            = tmp_rs_table[k].hub6;
        req.iomem_base      = ioremap((int)tmp_rs_table[k].iomem_base, PAGE_SIZE);
        req.iomem_reg_shift = tmp_rs_table[k].iomem_reg_shift;
        req.type            = tmp_rs_table[k].type;
        req.xmit_fifo_size  = tmp_rs_table[k].xmit_fifo_size;
        req.custom_divisor  = tmp_rs_table[k].custom_divisor;
        req.closing_wait    = tmp_rs_table[k].closing_wait;

                                early_serial_setup(&req);
                        }
                }
        }


-Frank
--
Frank Rowand <frank_rowand@mvista.com>
MontaVista Software, Inc


  reply	other threads:[~2001-11-29 17:57 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-27 11:32 include/asm-ppc/platforms/ Paul Mackerras
2001-11-27 15:22 ` include/asm-ppc/platforms/ Tom Rini
2001-11-27 20:06   ` include/asm-ppc/platforms/ Roman Zippel
2001-11-28  2:35   ` include/asm-ppc/platforms/ Keith Owens
2001-12-27 14:59 ` include/asm-ppc/platforms/ Dan Malek
2001-11-27 12:00   ` include/asm-ppc/platforms/ Matt Porter
2001-11-27 15:18     ` include/asm-ppc/platforms/ Geert Uytterhoeven
2001-12-27 15:18     ` include/asm-ppc/platforms/ Dan Malek
2001-11-27 23:44   ` include/asm-ppc/platforms/ Wolfgang Denk
2001-11-28  6:13   ` include/asm-ppc/platforms/ Paul Mackerras
2001-11-28  6:23     ` include/asm-ppc/platforms/ Dan Malek
2001-11-29 11:48       ` include/asm-ppc/platforms/ Paul Mackerras
2001-11-29 15:26         ` include/asm-ppc/platforms/ Tom Rini
2001-11-29 22:19           ` include/asm-ppc/platforms/ Keith Owens
2001-11-29 22:27             ` include/asm-ppc/platforms/ Tom Rini
2001-11-29 22:38               ` include/asm-ppc/platforms/ Keith Owens
2001-11-29 22:46                 ` include/asm-ppc/platforms/ Tom Rini
2001-11-29 23:12                   ` include/asm-ppc/platforms/ Keith Owens
2001-11-29 23:18                     ` include/asm-ppc/platforms/ Tom Rini
2001-11-28  8:46     ` include/asm-ppc/platforms/ Adrian Cox
2001-11-28 21:34       ` include/asm-ppc/platforms/ Paul Mackerras
2001-11-28 21:46         ` include/asm-ppc/platforms/ Adrian Cox
2001-11-29 17:57           ` Frank Rowand [this message]
2001-11-28 23:50       ` include/asm-ppc/platforms/ Tom Rini
2001-11-29 10:57       ` include/asm-ppc/platforms/ Paul Mackerras
2001-11-28 23:51     ` include/asm-ppc/platforms/ Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2001-11-30 13:30 include/asm-ppc/platforms/ Ralph Blach
2001-11-30 22:08 ` include/asm-ppc/platforms/ Paul Mackerras
2001-11-30 23:22   ` include/asm-ppc/platforms/ Frank Rowand
2001-12-01  3:31     ` include/asm-ppc/platforms/ Dan Malek
2001-12-01 18:19       ` include/asm-ppc/platforms/ Frank Rowand
2001-12-01 22:22         ` include/asm-ppc/platforms/ Dan Malek
2001-12-01 22:41           ` include/asm-ppc/platforms/ Tom Rini
2001-12-01  0:19   ` include/asm-ppc/platforms/ Armin Kuster

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=3C0676EE.BAE43398@mvista.com \
    --to=frank_rowand@mvista.com \
    --cc=adrian@humboldt.co.uk \
    --cc=frowand@mvista.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=paulus@samba.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.