From: Arnd Bergmann <arnd@arndb.de>
To: Daniel Palmer <me@danielpalmer.co.uk>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: PATA_ARTOP reads byte from PCI IO port without mapping it to the right address.
Date: Wed, 30 Mar 2011 22:00:46 +0200 [thread overview]
Message-ID: <201103302200.47052.arnd@arndb.de> (raw)
In-Reply-To: <4D93890A.60307@danielpalmer.co.uk>
On Wednesday 30 March 2011 21:48:26 Daniel Palmer wrote:
> > That is the PCI port address.
>
> I don't pretend to understand most of this fully.
> On the board the PCI address space/PCI controller is apparently at
> 0xfe240000
> So I guess that when that byte is read it should read from 0xfe240000 +
> 0x1400?
> That doesn't happen and a read happens at 0x1400 and an oops results.
> I don't know enough to point the finger really.
>
> There are probably only 2 people using this board still too. So I doubt
> it really matters. :)
Is this an ARM machine? The platform specific mach/io.h header file
in that case defines an __io() macro that is responsible for mapping
port numbers to virtual addresses.
You have to ioremap() the physical address 0xfe240000 to a virtual
address, and then add the base address to the number inside of the
__io macro, e.g.
/* in mach/io.h: */
extern void __iomem *this_board_pci_iospace;
#define __io(x) ((x & 0xffff) + this_board_pci_iospace)
/* in pci controller setup code: */
this_board_pci_iospace = ioremap(0xfe240000, 0x10000);
Arnd
next prev parent reply other threads:[~2011-03-30 20:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-30 19:09 PATA_ARTOP reads byte from PCI IO port without mapping it to the right address Daniel Palmer
2011-03-30 19:26 ` Alan Cox
2011-03-30 19:36 ` Linus Torvalds
2011-03-30 19:48 ` Daniel Palmer
2011-03-30 20:00 ` Arnd Bergmann [this message]
2011-03-30 20:24 ` Daniel Palmer
2011-03-30 20:37 ` Arnd Bergmann
2011-03-30 20:24 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201103302200.47052.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@danielpalmer.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox