linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Peter Korsgaard" <peter.korsgaard@barco.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: [RFC] uartlite driver MicroBlaze compatability
Date: Wed, 2 May 2007 09:59:37 -0600	[thread overview]
Message-ID: <528646bc0705020859u3f15315v907759d4ea8c71a5@mail.gmail.com> (raw)
In-Reply-To: <87wszr48sc.fsf@sleipner.barco.com>

On 5/2/07, Peter Korsgaard <peter.korsgaard@barco.com> wrote:
> >>>>> "GL" == Grant Likely <grant.likely@secretlab.ca> writes:
>
> Hi,
>
> GL> Hmm, I think I was smoking something last night.
>
> ;)
>
> GL>  Address used for 8 bit access should not be affected by CPU
> GL> endianess.  After David's comments, I reread the uartlite
> GL> documentation.  The current design is definately for 32bit OPB bus
> GL> connections, but it looks like there is a posibility for xilinx to
> GL> add a 16 or 8 bit attachment.  Since the uartlite design
> GL> explicitly supports 8, 16 and 32 bit access, sticking with 8 bit
> GL> io may be the safest.  However, I still think the application of
> GL> the 3 byte offset should be done in the driver, and not in the
> GL> platform bus registration.
>
> That would effectively make the driver big endian only. What if Xilinx
> would come out with a FPGA with a ARM core in it?

It shouldn't.  When doing byte-wise access, byte 3 is *always* byte 3;
regardless of the endianess of the processor.  It's the endianess of
the device that determines where the individual bytes show up.  The
opb_uartlite documentation defines the registers as big endian,
therefore if you do a bytewise access to address 0x3, you'll always
get the least significant byte of the first register.

Since the 3 byte offset does not change between little endian and big
endian processors then I think the knowledge of the offset should be
kept in the driver, not the device registration.

>
> GL> I've reworked the patch with the following changes - remove 3 byte
> GL> offset from platform bus registration.  - added ulite_in/ulite_out
> GL> macros to make changing bus attachment details simpler if xilinx
> GL> changes the uartlite design.  - stick with 8 bit IO.
>
> Russell didn't like those accessor macros back when it was submitted
> last year:

 >> +static inline void serial_out(struct uart_port *port, int offset, int
 Russell> Since there's no additional complication here, do you need separate
 Russell> serial_in/serial_out inline functions?

As I think the driver should know about the 3 byte offset; the
accessor macro makes sense again.  Plus if Xilinx ever adds a uartlite
varient w/ bytewise or halfword wise registers it becomes much easier
to taylor in the future.

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

  reply	other threads:[~2007-05-02 15:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-01  4:55 [RFC] uartlite driver MicroBlaze compatability John Williams
2007-05-01  5:55 ` Grant Likely
2007-05-01  6:42   ` John Williams
2007-05-02  5:47     ` Grant Likely
2007-05-02  6:18       ` John Williams
2007-05-02 14:09       ` Peter Korsgaard
2007-05-02 15:59         ` Grant Likely [this message]
2007-05-02 13:59   ` Peter Korsgaard
2007-05-02 13:45 ` Peter Korsgaard
2007-05-03  1:08   ` John Williams
2007-05-03 10:22     ` David H. Lynch Jr.

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=528646bc0705020859u3f15315v907759d4ea8c71a5@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=peter.korsgaard@barco.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;
as well as URLs for NNTP newsgroup(s).