linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: wolfking <wolfking2000@msn.com>
To: linuxppc-dev@ozlabs.org
Subject: can't access PCIe card under sbc8548
Date: Wed, 29 May 2013 20:42:01 -0700 (PDT)	[thread overview]
Message-ID: <1369885321567-71775.post@n7.nabble.com> (raw)

hi, all
  I'm doing some developing on the windriver's sbc8548 board. The kernel I
use
is 3.6.10 and the u-boot version is 2012-10. I changed the board's
configuration:
the board now boot from the 64MB SODIMM Flash (not the default 8MB on-board
Flash
memory), and the PCI clock rate is changed to 33MHZ.
  Now the trouble I am in is that: the PCI card (a NIC card rtl8139) can be 
accessed OK, while the PCIe card can't work, that is, the kernel can't
access
its internal register. The kernel can correctly probe the PCIe card. its
BAR0 
is a I/O mapped register, I use ioport_map to map the BAR0 to kernel's
address
space, then use ioread8/iowrite8 to access its internal register, it doesn't
work.
I analyse the ioport_map function and find it just add the input parameter
to
a fixed _IO_BASE value, below is the function:
void __iomem *ioport_map(unsigned long port, unsigned int len)
{
	return (void __iomem *) (port + _IO_BASE);
}
the _IO_BASE value under sbc8548 is 0xfd7fd000, the value of ioport_map
paramenter 
"port" is 0xfefff000. Obviously the add overflows, so the follow-up
operations 
can't succeed. The value of "port" is got from the function
pci_resource_start.
So I guess the kernel allocate a bad address to this PCIe card. How can I
fix this?
  I also plug this PCIe card into a freescale's board mpc8641-hpcn, try the
same driver,
I noticed ioport_map also meet overflow, but it does work fine. So I'm
messed, :<



--
View this message in context: http://linuxppc.10917.n7.nabble.com/can-t-access-PCIe-card-under-sbc8548-tp71775.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

             reply	other threads:[~2013-05-30  4:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30  3:42 wolfking [this message]
2013-05-30  5:56 ` can't access PCIe card under sbc8548 tiejun.chen
2013-05-30  7:19   ` wolfking
2013-05-30  8:47     ` tiejun.chen
2013-05-30  9:15       ` wolfking
2013-05-30  9:30         ` tiejun.chen
2013-05-30  7:32   ` wolfking
2013-05-30 10:42     ` tiejun.chen
2013-05-30 12:49       ` wolfking
2013-05-30 16:24         ` Scott Wood
2013-05-31  1:34           ` tiejun.chen
2013-05-31  2:27             ` wolfking
2013-05-31 10:00           ` Benjamin Herrenschmidt
2013-05-30 10:02 ` wolfking
2013-05-30 10:08   ` tiejun.chen
2013-05-30 12:45     ` wolfking
2013-05-30 16:29 ` Scott Wood
2013-05-31  0:40   ` wolfking
2013-05-31 10:01     ` Benjamin Herrenschmidt
2013-05-31 12:46       ` wolfking
2013-06-08  7:00         ` wolfking

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=1369885321567-71775.post@n7.nabble.com \
    --to=wolfking2000@msn.com \
    --cc=linuxppc-dev@ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).