From: Marek Vasut Date: Sun, 3 May 2020 16:56:46 +0200 Subject: [PATCH 2/2] net: pcnet: Switch to PCI memory access In-Reply-To: <2deb2455-53a8-2b28-19c8-10babdb79476@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> <2deb2455-53a8-2b28-19c8-10babdb79476@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 5/2/20 5:03 PM, Daniel Schwierzeck wrote: > > > 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); > } I'm CCing Tom. He didn't pick the PR yet. If you want to send it as separate patch, fine by me, maybe Tom can pick that one right after the PR ; or I can squash it into the PR. I think the former would be easier. -- Best regards, Marek Vasut