linux-mips
[Top] [All Lists]

Re: IDE DMA mode in Big endian for mips

To: Atsushi Nemoto <nemoto@toshiba-tops.co.jp>
Subject: Re: IDE DMA mode in Big endian for mips
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed, 17 Oct 2001 07:48:27 +0200 (MEST)
Cc: hli@quicklogic.com, Linux/MIPS Development <linux-mips@oss.sgi.com>
In-reply-to: <20011017.113842.41627007.nemoto@toshiba-tops.co.jp>
Sender: owner-linux-mips@oss.sgi.com
On Wed, 17 Oct 2001, Atsushi Nemoto wrote:
> >>>>> On Tue, 16 Oct 2001 10:28:56 -0400, "Hanks Li" <hli@quicklogic.com> 
> >>>>> said:
> hli> We are working on the IDE/ATAPI for mips. When I changed to Big
> hli> endian mode, the following information appared, and the program
> hli> hang.
> 
> When I tried PCI-IDE in BigEndian (with 2.4.6 kernel), this patch
> solved my problem.
> 
> --- linux/drivers/ide/ide-dma.c:1.1.1.1       Fri Jul  6 11:24:54 2001
> +++ linux/drivers/ide/ide-dma.c       Fri Aug 17 20:17:30 2001
> @@ -492,7 +492,11 @@
>                       SELECT_READ_WRITE(hwif,drive,func);
>                       if (!(count = ide_build_dmatable(drive, func)))
>                               return 1;       /* try PIO instead of DMA */
> +#if defined(__mips__) && defined(__BIG_ENDIAN) /* XXX mips only? */
> +                     outl(cpu_to_le32(hwif->dmatable_dma), dma_base + 4); /* 
> PRD table */
> +#else
>                       outl(hwif->dmatable_dma, dma_base + 4); /* PRD table */
> +#endif

Since cpu_to_le32() does nothing on little endian, you can rewrite it like

    #if defined(__mips__) /* XXX mips only? */
                            outl(cpu_to_le32(hwif->dmatable_dma), dma_base + 
4); /* PRD table */
    #else
                            outl(hwif->dmatable_dma, dma_base + 4); /* PRD 
table */
    #endif

Gr{oetje,eeting}s,

                                                Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                                            -- Linus Torvalds


<Prev in Thread] Current Thread [Next in Thread>