lkml.org 
[lkml]   [2013]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] drivers/block/xsysace - replace in(out)_8/in(out)_be16/in(out)_le16 with generic iowrite(read)8/16(be)
Date
On Tuesday 12 February 2013, Michal Simek wrote:
> But on Microblaze LE is necessary to use different datain/out_le16
> functions as below
> which are also not compatible with Microblaze and PPC BE.
>
> diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
> index bbad046..8dd192c 100644
> --- a/drivers/block/xsysace.c
> +++ b/drivers/block/xsysace.c
> @@ -314,7 +314,7 @@ static void ace_datain_le16(struct ace_device *ace)
> int i = ACE_FIFO_SIZE / 2;
> u16 *dst = ace->data_ptr;
> while (i--)
> - *dst++ = ioread16be(ace->baseaddr + 0x40);
> + *dst++ = ioread16(ace->baseaddr + 0x40);
> ace->data_ptr = dst;
> }

Hmm, that actually seems sane then: You can replace the loop around
ioread16be with a single ioread32_rep() call, which will use
the correct native endian accesses on both LE Microblaze
and on all the big-endian platforms. Note that the asm-generic
definition of that function was broken until quite recently
when Will Deacon repaired it in order to support ARM64.

Arnd


\
 
 \ /
  Last update: 2013-02-12 19:01    [W:0.161 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site