linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: MPC8250 + PCMCIA + airo_cs card + IO Port mapping proble
       [not found] <5.1.0.14.2.20030522143346.04b7e260@falcon.si.com>
@ 2003-05-23  4:01 ` Jim Rowe
  2003-05-23 22:14   ` Jim Rowe
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Rowe @ 2003-05-23  4:01 UTC (permalink / raw)
  To: Jerry Van Baren; +Cc: linuxppc-embedded


On Thu, 2003-05-22 at 11:35, Jerry Van Baren wrote:
> Kernel memory space starts at 0xC0000000.  You need to set your I/O well
> above this (above the kernel executable).  It is illegal to have I/O below
> the kernel (its a memory management issue).  That is why the common IMMR
> setting is 0xF0000000.  I would suggest you try setting your PCI window at
> 0xF8000000 or something like that.
>
> gvb

Ok, thanks for the pointer. I've scooted my PCI IO space up in memory to
where I had room.

This is how my IO is now setup:

    pci_init_resource(&hose->io_resource,
                       0xd0000000,
                       0xdfffffff,
                       IORESOURCE_IO,
                       "PCI host bridge");

    pci_init_resource (&hose->mem_resources[0],
                        0x80000000,
                        0x803fffff,
                        IORESOURCE_MEM,
                        "PCI host bridge");

     hose->io_space.start = 0xd0000000;
     hose->io_space.end = 0xdfffffff;
     hose->mem_space.start = 0x7ff00000;
     hose->mem_space.end = 0x803fffff;
     hose->io_base_virt = (void *)0;

my _IO_BASE is now 0xd0000000 and I do

io_block_mapping(0xd0000000, 0xd0000000, 0x1000000, _PAGE_IO);

early when the board is getting setup.


I've also setup PCIBR0 and PCIBR1 in the boot loader to have windows of
0x80000000 to 0xbfffffff and 0xd0000000 to 0xdfffffff.


Now when I try to write to the PCMCIA card, I don't see anything go out
on the PCMCIA bus (write enable and chipselect don't change).  A printk
in the out_le16() routine shows that the address seems to be correct
(0xd00000102), but when I try to read from the card I get a Machine
Check Exception that is "Transfer ack error". I suspect that my IO
mapping is still not correct.

I know that the board is wired up correctly because the I am able to
read the card's CIS through io memory. Why aren't my IO Ports working?


-- James

>
>
> At 12:29 PM 5/22/2003 -0400, you wrote:
>
> >On Wed, 2003-05-21 at 21:33, Dan Malek wrote:
> > > Jim Rowe wrote:
> > >
> > > >>From what I can see - and please correct me if I'm wrong, the way that
> > > > Linux translates the Port IO to the memory mapped IO is through the outb
> > > > and outw macros, which add an offset of _IO_BASE. How do I determine the
> > > > correct value of _IO_BASE?
> > >
> > > The value of _IO_BASE depends upon how you configure and map the host PCI
> > > bridge on the 8250.
> >
> >Here is how my PCI bridge gets mapped:
> >
> >     pci_init_resource(&hose->io_resource,
> >                       0xb0000000,
> >                       0xb00fffff,
> >                       IORESOURCE_IO,
> >                       "PCI host bridge");
> >
> >     pci_init_resource (&hose->mem_resources[0],
> >                        0x80000000,
> >                        0x803fffff,
> >                        IORESOURCE_MEM,
> >                        "PCI host bridge");
> >
> >     hose->io_space.start = 0xb0000000;
> >     hose->io_space.end = 0xb00fffff;
> >     hose->mem_space.start = 0x7ff00000;
> >     hose->mem_space.end = 0x803fffff;
> >     hose->io_base_virt = (void *)0;
> >
> >
> >
> > >
> > > > ... I looked in m8260_setup.c and found
> > >
> > > The 8260 doesn't have a PCI bridge, so these mappings aren't appropriate
> > > for your board.  The 0xf0000000 is needed to get to the IMMR space, but
> > > those accesses don't (shouldn't) be using in/out macros.  The 0xe0000000
> > > space is generally used for flash prom, external devices, local sdram
> > > and so on.
> >
> >I am basing the 8250 startup from the m8260_setup.c file.
> >
> >
> > >
> > > There are a variety of configuration options for the PCI bridge and all of
> > > the other I/O in your system and the mapping using either BATs or page
> > > tables.  It depends upon the address ranges of all of the I/O in your
> > > system and their physical space allocation.
> > >
> >
> >It looks like my _IO_BASE should be 0xb0000000. I've added a line in
> >m8260_setup.c to do
> >
> >         io_block_mapping(0xb0000000, 0xb0000000, 0x000fffff, _PAGE_IO);
> >
> >however, I get an Oops when I try to write with an outw(). From my debug
> >statements I see the address I'm trying to write to is
> >
> >16-bit write: addr:b0000102 val:00000000
> >
> >which looks correct since it is adding the 0xb0000000 offset.
> >
> >Does it look like I have my mapping setup properly, and if so why am I
> >still getting Oopses?
> >
> >
> >
> > >
> > >       -- Dan
> > >
> > >
> >--
> >Jim Rowe
> >Advanced CounterMeasure Systems
> >Phone: (916)669-4304
> >Email: jrowe@acmsystems.com
> >
> >
>
>
>
> **********************************************************************
> This e-mail and any files transmitted with it may be confidential and
> may be legally privileged or otherwise exempt from disclosure under
> applicable law. This e-mail and its files are intended solely for
> the individual or entity to whom they are addressed and their content
> is the property of Smiths Aerospace.  If you are not the intended
> recipient, please do not read, copy, use or disclose this communication.
> If you have received this e-mail in error please notify the e-mail
> administrator at postmaster@smiths-aerospace.com and then delete this
> e-mail, its files and any copies.
>
> This footnote also confirms that this e-mail message has been scanned
> for the presence of known computer viruses.
>
> Smiths addresses are changing!  The new addresses are of the form
> firstname.lastname@smiths-aerospace.com.  Please update your address
> books!  Please begin using the new form immediately.
> ***********************************************************************
--
Jim Rowe
Advanced CounterMeasure Systems
Phone: (916)669-4304
Email: jrowe@acmsystems.com


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MPC8250 + PCMCIA + airo_cs card + IO Port mapping proble
  2003-05-23 22:14   ` Jim Rowe
@ 2003-05-23 21:45     ` Dan Malek
  2003-05-23 22:44     ` Wolfgang Denk
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Malek @ 2003-05-23 21:45 UTC (permalink / raw)
  To: Jim Rowe; +Cc: linuxppc-embedded


Jim Rowe wrote:

> ....It would be even better if you are
> using an MPC82xx chip with an integrated PCI controller.

Take a look at the 8245 with the integrated MPC10x PCI bridge.
Basically, the Sandpoint port.  The 8250 is a more simple
implementation than this.  The 405GP/Walnut would also be
a good example, just don't get mired in the details that it
doesn't have BATs :-)


	-- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MPC8250 + PCMCIA + airo_cs card + IO Port mapping proble
  2003-05-23  4:01 ` MPC8250 + PCMCIA + airo_cs card + IO Port mapping proble Jim Rowe
@ 2003-05-23 22:14   ` Jim Rowe
  2003-05-23 21:45     ` Dan Malek
  2003-05-23 22:44     ` Wolfgang Denk
  0 siblings, 2 replies; 4+ messages in thread
From: Jim Rowe @ 2003-05-23 22:14 UTC (permalink / raw)
  To: linuxppc-embedded


If anyone has a 16-bit pcmcia card working with a Cardbus to PCI bridge
it would be very helpful if I could see your /proc/ioports and
/proc/iomem with the card working. It would be even better if you are
using an MPC82xx chip with an integrated PCI controller.

Thanks,
-- Jim


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MPC8250 + PCMCIA + airo_cs card + IO Port mapping proble
  2003-05-23 22:14   ` Jim Rowe
  2003-05-23 21:45     ` Dan Malek
@ 2003-05-23 22:44     ` Wolfgang Denk
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2003-05-23 22:44 UTC (permalink / raw)
  To: Jim Rowe; +Cc: linuxppc-embedded


In message <1053728074.29793.30.camel@kneedragger> you wrote:
>
> If anyone has a 16-bit pcmcia card working with a Cardbus to PCI bridge
> it would be very helpful if I could see your /proc/ioports and
> /proc/iomem with the card working. It would be even better if you are
> using an MPC82xx chip with an integrated PCI controller.

This is on  a  MPC8250  system  (ATC  board  in  U-Boot  and  in  our
linuxppc_2_4_devel  tree).  There  is  a  compact  flash  card  on it
attached to an Intel 82365 and PC Card controller.

bash-2.05# cat /proc/ioports
bash-2.05# cat /proc/iomem
00000000-ffffffff : <BAD>
  80000000-80000fff : PCI device 104c:ac56 (Texas Instruments)
    80000000-80000fff : i82365
  81000000-81000fff : card services

As you can see, we use the standard PCMCIA Card Services package.

Hope this helps.


Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
A direct quote from the Boss: "We passed over a lot of good people to
get the ones we hired."

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-23 22:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5.1.0.14.2.20030522143346.04b7e260@falcon.si.com>
2003-05-23  4:01 ` MPC8250 + PCMCIA + airo_cs card + IO Port mapping proble Jim Rowe
2003-05-23 22:14   ` Jim Rowe
2003-05-23 21:45     ` Dan Malek
2003-05-23 22:44     ` Wolfgang Denk

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).