Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1355317

Re: [PATCH] arc: use little endian accesses

From Lada Trimasova <Lada.Trimasova@synopsys.com>
Newsgroups linux.kernel
Subject Re: [PATCH] arc: use little endian accesses
Date 2016-03-10 20:00 +0100
Message-ID <rbdYu-2Ao-9@gated-at.bofh.it> (permalink)
References <raQ5R-2LL-29@gated-at.bofh.it> <rb11g-2cG-17@gated-at.bofh.it> <rb3w5-3HD-5@gated-at.bofh.it> <rb5xT-53y-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Vineet, Alexey, Arnd,
On Thu, 2016-03-10 at 09:55 +0000, Vineet Gupta wrote:

Can you or Lada provide more details as to exactly what is not working - what
driver to be precise 8250 or dw-8250.
And where exactly the failure shows up. I want to understand this more
Noam told me off list that he has no issues with both big endian ARC + 8250 in
systemc model or silicon.

-Vineet



Driver is 8250, kernel is built for BE arc, nsim option in model "nsim_isa_big_endian = 1".

With current "readl" and "writel" implementation for ARC we read word from memory without any endianess manipulation. So in case of little endian architecture we get what we want: the first memory byte is the low byte in the word. But in case of big endian architecture the word endianess is swapped: the first memory byte is the high word byte.

And for example, let's see what happens when we use "readl" in  function "serial8250_early_in" in driver/tty/serial/8250.

Take a look to one line from memory dump:
0xf0000010: 0x0b    0x00    0x00    0x00    0x60    0x00    0x00    0x00

When kernel is built for little endian architecture, we read this data in status register in function "serial_putc" using "readl" function in driver/tty/serial/8250 as:
r0: 0x0000006
The low byte is 0x0b, so the condition "if ((status & BOTH_EMPTY) == BOTH_EMPTY)"  is true, as BOTH_EMPTY is some mask with low bytes set.

When kernel is built with "CPU_BIG_ENDIAN" and model nsim option is "nsim_isa_big_endian=1", we read this data as:
r0: 0x6000000
So as you can see the low byte is 0x00 and above mentioned condition never becomes true, we can't continue initialization.


Regards,
Lada

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] arc: use little endian accesses Lada Trimasova <Lada.Trimasova@synopsys.com> - 2016-03-09 18:30 +0100
  Re: [PATCH] arc: use little endian accesses Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-03-10 06:10 +0100
    Re: [PATCH] arc: use little endian accesses Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-03-10 06:30 +0100
    Re: [PATCH] arc: use little endian accesses Arnd Bergmann <arnd@arndb.de> - 2016-03-10 08:50 +0100
      Re: [PATCH] arc: use little endian accesses Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-03-11 06:20 +0100
    Re: [PATCH] arc: use little endian accesses Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-03-10 08:50 +0100
      Re: [PATCH] arc: use little endian accesses Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-03-10 11:00 +0100
        Re: [PATCH] arc: use little endian accesses Lada Trimasova <Lada.Trimasova@synopsys.com> - 2016-03-10 20:00 +0100
          Re: [PATCH] arc: use little endian accesses Arnd Bergmann <arnd@arndb.de> - 2016-03-10 20:30 +0100
            Re: [PATCH] arc: use little endian accesses Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-03-11 13:50 +0100
              Re: [PATCH] arc: use little endian accesses Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-03-12 05:30 +0100
          Re: [PATCH] arc: use little endian accesses Noam Camus <noamca@mellanox.com> - 2016-03-11 06:30 +0100

csiph-web