From: Daniel Schwierzeck Date: Sat, 2 May 2020 17:03:26 +0200 Subject: [PATCH 2/2] net: pcnet: Switch to PCI memory access In-Reply-To: <0826f00c-4c60-1ef3-aba0-ee2d940708fa@gmail.com> References: <20200418031543.427069-1-marek.vasut+renesas@gmail.com> <20200418031543.427069-2-marek.vasut+renesas@gmail.com> <0826f00c-4c60-1ef3-aba0-ee2d940708fa@gmail.com> Message-ID: <2deb2455-53a8-2b28-19c8-10babdb79476@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 02.05.20 um 17:00 schrieb Daniel Schwierzeck: > Hi Marek, > > Am 18.04.20 um 05:15 schrieb Marek Vasut: >> Replace the PCI IO access with PCI memory access, the card >> supports both, but the former does not work with QEMU SH4. >> >> Signed-off-by: Marek Vasut >> Cc: Daniel Schwierzeck >> Cc: Joe Hershberger >> --- >> Note: It would be good to test this on the mips malta >> --- >> drivers/net/pcnet.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> ... > > > Contrary to SH there is a difference between memory access and IO access > on MIPS. So you have to replace also all inw()/outw() with > readw()/writew() like so: > > static u16 pcnet_read_csr(struct eth_device *dev, int index) > { > - writew(index, dev->iobase + PCNET_RAP); > - return readw(dev->iobase + PCNET_RDP); > + void __iomem *base = (void __iomem *)dev->iobase; > + writew(index, base + PCNET_RAP); > + return readw(base + PCNET_RDP); > } sorry wrong diff, I meant: static u16 pcnet_read_csr(struct eth_device *dev, int index) { - outw(index, dev->iobase + PCNET_RAP); - return inw(dev->iobase + PCNET_RDP); + void __iomem *base = (void __iomem *)dev->iobase; + writew(index, base + PCNET_RAP); + return readw(base + PCNET_RDP); } -- - Daniel