From: Timur Tabi <timur@freescale.com>
To: Arnd Bergmann <arnd@arndb.de>,
PowerPC dev list <Linuxppc-dev@ozlabs.org>
Subject: Re: ucc_uart: add support for Freescale QUICCEngine UART
Date: Wed, 05 Dec 2007 11:06:44 -0600 [thread overview]
Message-ID: <4756DAA4.7070702@freescale.com> (raw)
In-Reply-To: <200712050037.11489.arnd@arndb.de>
Arnd Bergmann wrote:
> In that case, I think the right solution would be to have different properties
> in the device tree, depending on whether or not you have a soft-uart and whether
> you need to download the microcode.
> Having only a compile time option is very bad because it prevents you from
> using the driver on a multi-platform kernel.
I can see putting the option to need Soft-UART in the device, because this is an
attribute of the hardware. The silicon is broken and UART functionality is
provided via a secondary mechanism.
I'm not so crazy about an option to tell the driver to upload the firmware. So
look at this:
ucc@2400 {
device_type = "serial";
compatible = "ucc_uart";
model = "UCC";
device-id = <5>; /* The UCC number, 1-7*/
port-number = <0>; /* Which ttyQEx device */
soft-uart; /* We need Soft-UART */
upload-firmware; /* Driver should upload FW */
...
In a sense, this is just a message from U-Boot to the driver. It's not really
an attribute of the hardware.
One thing I could do is create a new node under the QE node that describes any
uploaded microcode. The nature of the QE microcode is that only one can be
present at any time. So I could do this:
qe@e0100000 {
#address-cells = <1>;
#size-cells = <1>;
device_type = "qe";
model = "QE";
ranges = <0 e0100000 00100000>;
...
microcode@100 { /* 100 is offset within I-RAM where the microcode was uploaded */
name = "Soft-UART";
extended_modes = <0 0>;
vtraps = <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>;
}
The extended_modes and vtraps are data that the driver needs any way (for
Soft-UART, it's all zeros, but not for other microcodes). I currently don't
have a way to pass this information from U-Boot to the kernel. The driver could
then look for this node, and if it finds it, it would know *not* to try to
upload the microcode itself. And it would also have the extended_modes and
vtraps information that it might need.
This would solve your problem and mine.
> gcc tries to use only aligned accesses, depending on the the target CPU, so
> you may end up accessing a member as bytes instead of words.
Would it do that even if the member were naturally aligned? I find that hard to
believe, since the compiler always knows the alignment of its members.
OTOH, if this
> structure is always in __iomem and you use in_be32() and the like, there is
> no problem at all.
I do. I generally only pack structures that are defined by external hardware,
and this is one.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2007-12-05 17:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-04 17:51 ucc_uart: add support for Freescale QUICCEngine UART Timur Tabi
2007-12-04 22:13 ` Arnd Bergmann
2007-12-04 22:33 ` Timur Tabi
[not found] ` <200712050037.11489.arnd@arndb.de>
2007-12-05 17:06 ` Timur Tabi [this message]
2007-12-04 22:39 ` Timur Tabi
2007-12-04 23:26 ` Arnd Bergmann
2007-12-04 23:32 ` Scott Wood
2007-12-04 23:39 ` Arnd Bergmann
2007-12-04 23:44 ` Scott Wood
2007-12-04 23:47 ` Timur Tabi
2007-12-04 23:56 ` Arnd Bergmann
2007-12-05 0:59 ` Vitaly Bordug
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=4756DAA4.7070702@freescale.com \
--to=timur@freescale.com \
--cc=Linuxppc-dev@ozlabs.org \
--cc=arnd@arndb.de \
/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.