linux-mips
[Top] [All Lists]

Re: "Hw. address read/write mismap 0" or RTL8019 ethernet in linux

To: zhuzhenhua <zzh.hust@gmail.com>
Subject: Re: "Hw. address read/write mismap 0" or RTL8019 ethernet in linux
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date: Tue, 21 Feb 2006 11:44:18 +0000
Cc: linux-mips <linux-mips@linux-mips.org>
In-reply-to: <50c9a2250602202133g2e7350aesdaf1df810c90cef8@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <50c9a2250602202133g2e7350aesdaf1df810c90cef8@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
On Maw, 2006-02-21 at 13:33 +0800, zhuzhenhua wrote:
> then i check the code and find it's in 8390.c, caused by uncorrect
> write of MAC addr, and now i repalce all the inb,outb,inb_p, outb_p
> with get_reg and put_reg in the 8390.c.as follow:
> 
> static unsigned char get_reg (unsigned int regno)
> {
>       return (*(volatile unsigned char *) regno);
> }
> 
> static void put_reg (unsigned int regno, unsigned char val)
> {
>       *(volatile unsigned char *) regno = val;
> }

Should be

        return readb(regno);

and

        writeb(val, regno)

if regno holds the ioremap result of the memory mapped address of the
8019. Right now 8390.c assumes PIO mappings and you hardware appears to
be MMIO ?

> does someone have any idea of this situation?

If the card is MMIO then make sure you are using readb/writeb and
ioremap properly, otherwise you may get cache consistency and other
strange errors.





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