public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Russell King <rmk@arm.linux.org.uk>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: uart_match_port() question
Date: Thu, 08 Dec 2005 10:13:45 +1100	[thread overview]
Message-ID: <1133997226.7168.93.camel@gaston> (raw)
In-Reply-To: <200512071515.11937.bjorn.helgaas@hp.com>


> ia64 has basically the same situation.  I decided it was a mistake to
> have the arch code register serial ports early, because we only learn
> about a few of the ports early, and the firmware console configuration
> determines which ones we learn about.
> 
> The consequence is that changing the firmware configuration changes the
> serial device names, which I thought was a bad thing.
> 
> I finally settled on this scheme:
> 	- discover default firmware port (pcdp.c)
> 	- set it up as an "early uart" which has no ttyS name
> 	  and runs in polled mode (early_serial_console_init())
> 	- register it as a console
> 	- let 8250_{pci,pnp,etc} discover all the ports and
> 	  figure out minor numbers (i.e., ttyS names)
> 	- locate the port that matches the default firmware port,
> 	  switch console to it, and unregister the "early uart"
> 	  (early_uart_console_switch())

Yup, I've been thinking about a similar approach yah. My main issue is
your last step: "locate the port that matches the default firmware
port". Right now, thins works because the early registration allow me to
know in advance what the ttyS number will be. If I go your way,  which I
'm tempted to do, I need to figure out precisely how to properly match
the ports. Part of the problem here is for example PIO. There is no such
thing as PIO on a PowerPC, it's purely a PCI abstraction, thus inX/outX
will only work once the PCI host briges have been discovered and their
IO space mapped (setup_arch() time, but I definitely want my early
console earlier). Thus, for early ports, we use the open firmware tree
to translate all (including PIO) addresses to MMIO in CPU space.

Thus, later on, when the serial driver kicks in, it can't match the PCI
IO resources it's getting from the PCI code to the MMIO physical
addresses or ioremaped addresses that were used at early boot time.

That sort of thing ...

Anyway, things work now with the fix for properly matching MMIO ports
with their physical address and my current mecanism, even if it's not
the nicest solution. I'll still look into reworking it a better way but
I don't have the time right now.



  reply	other threads:[~2005-12-07 23:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-27  0:21 uart_match_port() question Benjamin Herrenschmidt
2005-11-28 11:30 ` Russell King
2005-11-28 11:36   ` Benjamin Herrenschmidt
2005-12-07 22:15 ` Bjorn Helgaas
2005-12-07 23:13   ` Benjamin Herrenschmidt [this message]
2005-12-07 23:36     ` Bjorn Helgaas
2005-12-08  0:17       ` Benjamin Herrenschmidt
2005-12-08 16:26         ` Bjorn Helgaas

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=1133997226.7168.93.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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