linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Lite5200 and PCI1520
@ 2004-12-13 17:50 Zeitler, Nathan
  2004-12-13 21:13 ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Zeitler, Nathan @ 2004-12-13 17:50 UTC (permalink / raw)
  To: linuxppc-embedded

 Greetings all,
I would greatly appreciate some advice regarding getting Linux to read
and write to CompactFlash devices behind a PCI1520 PCI bridge on a
custom Lite5200 board.  I am admittedly new to this process within
embedded devices and could use some direction.  We're using a recent
2.4.25 kernel from Denx, as well as UBOOT 1.1.1 and ELDK2.1. =20

My status:
UBOOT detects the PCI Bridge just fine.  I'm able to read and write to
the registers within the PCI1520 using the BDI2000 as well as UBOOT's
pci command.  I've therefore set up the bridge to use its output to run
the power chip instead of reading an EEPROM for its settings.  I've also
set up the multifunction pins to be "parallel PCI only", as they are
connected to hardware "IRQ1" and "IRQ2" of the MPC5200.  I've tried
several different values for the Interrupt Line register, but am mostly
flying blind in this respect.  I've enabled most every PCMCIA option in
the Linux kernel I could find, enabled PnP and Cardbus support, but not
i82365 compatible bridge support as it seemed to scan for ISA resources
that weren't there (I understand the yenta driver doesn't want nor need
this anyway?).

My problem:
I can't access anything plugged into the sockets!  PCI1520 registers
detect a card is inserted, but I can't read and write to flash cards
from Linux.  I checked out PCMCIA Card Services from CVS, compiled and
ran cardmgr and it gives a seg-fault, but indicates it is watching the
sockets (debug output seems to confirm this).  I can read the status and
config using cardctl, but reading the identification or info causes
another seg fault.  I suspect I may be running into a combination of
interrupt and driver issues, but I need a knowledgeable opinion on this.
I'm most confused by the line between ISA and PCI IRQs, and how or why
CF uses these.  I've appended some interesting messages from Linux's
boot sequence.  Thanks in advance.

Linux Kernel Card Services 3.1.22
  options:  [pci] [cardbus]
yenta 00:18.0: no resource of type 100 available, trying to continue...

yenta 00:18.0: no resource of type 100 available, trying to continue...

yenta 00:18.1: no resource of type 100 available, trying to continue...

yenta 00:18.1: no resource of type 100 available, trying to continue...=20

/* type 100 =3D=3D IO_RESOURCE, recoding yenta.c to bind them=20
to a 0x5000nnnn address range stopped the error,=20
but seemed  to fix nothing */=20

...

Yenta ISA IRQ mask 0x0000, PCI irq 255
Socket status: 30000810
Yenta ISA IRQ mask 0x0000, PCI irq 255
Socket status: 30000006
/* 255 seems to be the default value,
But what should it be instead? */


Nathan Zeitler
Systems Engineer
Open Systems International, Inc.
3600 Holly Lane North, Suite 40
Minneapolis, MN 55447-1286
Phone: (763) 551-0559
Fax:     (763)551-0750
Email:  nzeitler@osii.com

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

* Re: Lite5200 and PCI1520
  2004-12-13 17:50 Zeitler, Nathan
@ 2004-12-13 21:13 ` Wolfgang Denk
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2004-12-13 21:13 UTC (permalink / raw)
  To: Zeitler, Nathan; +Cc: linuxppc-embedded

In message <01C22B6B78D52B46BE3C38FB525617EF909AC5@osimail.osii.com> you wrote:
>
> and write to CompactFlash devices behind a PCI1520 PCI bridge on a
> custom Lite5200 board.  I am admittedly new to this process within

Now what? Is it a custom board, or a Lite5200? 

> embedded devices and could use some direction.  We're using a recent
> 2.4.25 kernel from Denx, as well as UBOOT 1.1.1 and ELDK2.1.  

U-Boot 1.1.1 is old. You better use current code (top of CVS).

ELDK 2.1 is extremely old. You better use a current version (3.1).

> I can't access anything plugged into the sockets!  PCI1520 registers
> detect a card is inserted, but I can't read and write to flash cards
> from Linux.  I checked out PCMCIA Card Services from CVS, compiled and
> ran cardmgr and it gives a seg-fault, but indicates it is watching the

What's you PCMCIA config file looking like?


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Perl already has an IDE.  It's called Unix.
                      -- Tom Christiansen in 375bd509@cs.colorado.edu

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

* RE: Lite5200 and PCI1520
@ 2004-12-13 22:09 Zeitler, Nathan
  2004-12-13 23:48 ` Andrew Dennison
  0 siblings, 1 reply; 9+ messages in thread
From: Zeitler, Nathan @ 2004-12-13 22:09 UTC (permalink / raw)
  To: wd; +Cc: linuxppc-embedded

Hello Wolfgang,=20

>Now what? Is it a custom board, or a Lite5200?=20

My apologies.  It is a custom board based closely on the design of the
Lite5200.  Thus we are able to put a PCI1520 chip on the same PCB and
connect it to the MPC5200 PCI bus.

>U-Boot 1.1.1 is old. You better use current code (top of CVS).
>
>ELDK 2.1 is extremely old. You better use a current version (3.1).

Agreed, they are old, although I was hoping to be more certain that the
age of the toolchain was a problem first.  I have tried top-of-CVS
UBOOT, but reverted when no evident improvement occurred.=20
 =20
>What's you PCMCIA config file looking like?

Under /etc/sysconfig/pcmcia:
PCMCIA=3Dyes
PCIC=3Dyenta_socket
PCIC_OPTS=3D
CORE_OPTS=3D
CARDMGR_OPTS=3D

Under /etc/pcmcia/config.opts...=20
(This is as how I found it, although I added the 4th port address and
changed the memory range in an attempt to get it to cooperate.  I/O
resources aren't even being detected, so I tried adding 0x50000000 to
each I/O port address in yenta.c and adding the same value to each I/O
here to no avail):
include port 0x100-0x4ff, port 0x800-0x8ff, port 0xc00-0xcff, port
0x1000-0x10ff
include memory 0x40000000-0x40001fff
include port 0xa00-0xaff
exclude irq 4
exclude irq 7
module "ray_cs" opts "essid=3DADHOC_ESSID hop_dwell=3D128 =
beacon_period=3D256
translate=3D1"

Help with respect to getting the interrupts and anything further
(configuration files and more) is appreciated, although for the sake of
keeping on topic, I can send any Card Services-based queries to the
pcmcia-cs mailing list if so desired :-)

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

* RE: Lite5200 and PCI1520
  2004-12-13 22:09 Lite5200 and PCI1520 Zeitler, Nathan
@ 2004-12-13 23:48 ` Andrew Dennison
  2004-12-14  0:32   ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Dennison @ 2004-12-13 23:48 UTC (permalink / raw)
  To: 'Zeitler, Nathan', wd; +Cc: linuxppc-embedded

Nathan Zeitler wrote:

> Hello Wolfgang,
>=20
>> Now what? Is it a custom board, or a Lite5200?
>=20
> My apologies.  It is a custom board based closely on the design of the
> Lite5200.  Thus we are able to put a PCI1520 chip on the same PCB and
> connect it to the MPC5200 PCI bus.

Nathan,
I posted a question on cardbus with the 5200 a few weeks ago but got no
reply. I think the reason is that cardbus / pcmcia support may not have
been considered when the 5200 PCI memory map was laid out, but I would
love to be contradicted!

I also have a custom board with a mpc5200, pci1520 cardbus bridge, DDR,
etc.

Which kernel are you using?

I'm using Denx linuxppc_2_4_devel cvs and so far I've had to make =
several
changes to get close to a working system. I've changed the PCI bus =
mapping
so ISA I/O (ie PCMCIA) is at the bottom of the PCI address space, from =
my
reading / debugging this seems to be required to get PCMCIA to work. I
initially tried hacking yenta.c to use a high I/O range (like you have)
but this doesn't seem to be the solution. My memory map is now as =
follows:

/*
 * VPC mapping deviates from icecube so PCMCIA can work!
 * From Processor to PCI:
 *   PCI Mem Space: 0x40000000 - 0x50000000 -> 0x40000000 - 0x50000000
(256 MB)
 *   PCI I/O Space: 0x50000000 - 0x51000000 -> 0x00000000 - 0x01000000 =
(16
MB)
 *
 * From PCI to Processor:
 *   System Memory: 0x80000000 -> 0x00000000
 */

this also requires:
#define _IO_BASE	isa_io_base=20
and isa_io_base to be set to the correct virtual address, =
pci_dram_offset
=3D 0x8000000, among other changes.

I also have a few outstanding issues that I haven't resolved yet, hence =
I
haven't posted a full patch, but I can now load and configure a wireless
ethernet card. Loading cardbus drivers currently fails when accessing =
PCI
configuration space on the cardbus bus, and I haven't sorted this out =
yet.

Part of the reason for my reply is also to check if my current approach
(remapping the PCI address space) is sane - comments anyone? I have made
similar changes in u-boot and can now read / write CF cards so it seems
like the right approach for the kernel too.

Andrew

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

* RE: Lite5200 and PCI1520
@ 2004-12-14  0:06 Zeitler, Nathan
  2004-12-14  0:45 ` Andrew Dennison
  0 siblings, 1 reply; 9+ messages in thread
From: Zeitler, Nathan @ 2004-12-14  0:06 UTC (permalink / raw)
  To: Andrew Dennison; +Cc: linuxppc-embedded

Hello Andrew,

>Nathan,
>I posted a question on cardbus with the 5200 a few weeks ago but got no
reply. I think the reason is that=20
>cardbus / pcmcia support may not have been considered when the 5200 PCI
memory map was laid out, but I >would love to be contradicted!

This would certainly help explain some of the pain in getting it to
work.  :-/

>Which kernel are you using?

I'm using the 2.4.25 kernel from Denx also.  The version I have is a
couple months old (trying to keep from changing too many things at once!
:-)  ),but I have also tried the top-of-CVS version to no avail.  My
ELDK version is old, as explained earlier, but I'm taking steps to
change that.


>I also have a few outstanding issues that I haven't resolved yet, hence
I haven't posted a full patch, but I can=20
>now load and configure a wireless ethernet card. Loading cardbus
drivers currently fails when accessing PCI >configuration space on the
cardbus bus, and I haven't sorted this out yet.

It sounds like we're working towards the same end!  I would like to
assist in some way if possible.  I am willing to believe that remapping
the PCI bus is a possible approach, although I'd like to hear the
opinion of others as well.  Where in UBOOT did you change the PCI bus
mappings?

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

* Re: Lite5200 and PCI1520
  2004-12-13 23:48 ` Andrew Dennison
@ 2004-12-14  0:32   ` Wolfgang Denk
  2004-12-14  1:25     ` Andrew Dennison
  2004-12-17  7:11     ` Lite5200 and PCI1520 - preliminary patch Andrew Dennison
  0 siblings, 2 replies; 9+ messages in thread
From: Wolfgang Denk @ 2004-12-14  0:32 UTC (permalink / raw)
  To: Andrew Dennison; +Cc: linuxppc-embedded

Dear Andrew,

in message <002a01c4e16e$34451010$4000a8c0@CAT> you wrote:
> 
> I posted a question on cardbus with the 5200 a few weeks ago but got no
> reply. I think the reason is that cardbus / pcmcia support may not have
> been considered when the 5200 PCI memory map was laid out, but I would
> love to be contradicted!

I think I can confirm that this was not considered, but I'm not  sure
that this is an issue here.

> I also have a few outstanding issues that I haven't resolved yet, hence I
> haven't posted a full patch, but I can now load and configure a wireless
> ethernet card. Loading cardbus drivers currently fails when accessing PCI
> configuration space on the cardbus bus, and I haven't sorted this out yet.

I'd like to see your patch (even if preliminary).

> Part of the reason for my reply is also to check if my current approach
> (remapping the PCI address space) is sane - comments anyone? I have made
> similar changes in u-boot and can now read / write CF cards so it seems
> like the right approach for the kernel too.

Unfortunately I don't have any hardware yet with  a  working  cardbus
interface. But this might change soon...

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Men don't talk peace unless they're ready to back it up with war.
	-- Col. Green, "The Savage Curtain", stardate 5906.4

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

* RE: Lite5200 and PCI1520
  2004-12-14  0:06 Lite5200 and PCI1520 Zeitler, Nathan
@ 2004-12-14  0:45 ` Andrew Dennison
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Dennison @ 2004-12-14  0:45 UTC (permalink / raw)
  To: 'Zeitler, Nathan'; +Cc: linuxppc-embedded

On Tuesday, 14 December 2004 11:06 AM, Zeitler, Nathan wrote:

> Hello Andrew,
>=20
>=20
> This would certainly help explain some of the pain in getting it to
> work.  :-/=20

I understand your pain :)

> I'm using the 2.4.25 kernel from Denx also.  The version I have is a
> couple months old (trying to keep from changing too many
> things at once!

I'm actually using the "RTAI validated" version, but tried top of tree =
and
it doesn't help - no changes to the relevant parts.

> It sounds like we're working towards the same end!  I would like to
> assist in some way if possible. =20

Cool - no point us both doing the same stuff. I've actually taken a =
break
from this for the last week but you've given me renewed enthusiasm:)

> I am willing to believe that
> remapping the PCI bus is a possible approach, although I'd like to
> hear the opinion of others as well.  Where in UBOOT did you change
> the PCI bus mappings?

//Relevant section of u-boot/include/configs/VPC.h

/*
 * Physical                 PCI                      Resource
 * 0x00000000 - 0x3fffffff  0x80000000 - 0xBfffffff  SDRAM
 * 0x40000000 - 0x4fffffff  0x40000000 - 0x4fffffff  PCI Memory
 * 0x50000000 - 0x50ffffff  0x00000000 - 0x00ffffff  PCI IO Space
 */

#define CONFIG_SDRAM_PHYS	CFG_SDRAM_BASE
#define CONFIG_SDRAM_BUS	0x80000000
#define CONFIG_SDRAM_SIZE	(1024 * 1024 * 1024)

#define CONFIG_PCI_MEM_PHYS	0x40000000
#define CONFIG_PCI_MEM_BUS	0x40000000
#define CONFIG_PCI_MEM_SIZE	0x10000000

#define CONFIG_PCI_IO_PHYS	0x50000000
#define CONFIG_PCI_IO_BUS	0x00000000
#define CONFIG_PCI_IO_SIZE	0x01000000

// This section does the actual pcmcia setup, and is kinda OT for this
list...
// but included for completeness

#define CONFIG_I82365

#define CFG_PCMCIA_MEM_ADDR	0x40400000 /* after last cardbus base
							* window assigend
by
							* pci_auto, but
can be anywhere in PCI_MEM range*/
#define CFG_PCMCIA_MEM_SIZE	0x1000

#define CONFIG_IDE_8xx_PCCARD	1	/* Use IDE with PC Card Adapter */
#define CFG_IDE_MAXBUS		1	/* max. 1 IDE bus		*/
#define CFG_IDE_MAXDEVICE	1	/* max. 1 drive per IDE bus	*/

#define CFG_ATA_IDE0_OFFSET	0

#define CFG_ATA_BASE_ADDR	CONFIG_PCI_IO_PHYS

/* Offset for data I/O			*/
#define CFG_ATA_DATA_OFFSET	0x100 /* don't change - hard coded in
i82365 */

/* Offset for normal register accesses	*/
#define CFG_ATA_REG_OFFSET	0x100 /* don't change - hard coded in
i82365 */

/* Offset for alternate registers	*/
#define CFG_ATA_ALT_OFFSET	0x108 /* don't change - hard coded in
i82365 */

#define CONFIG_PCMCIA_SLOT_A	/* there can be only one... */

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

* RE: Lite5200 and PCI1520
  2004-12-14  0:32   ` Wolfgang Denk
@ 2004-12-14  1:25     ` Andrew Dennison
  2004-12-17  7:11     ` Lite5200 and PCI1520 - preliminary patch Andrew Dennison
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Dennison @ 2004-12-14  1:25 UTC (permalink / raw)
  To: wd; +Cc: linuxppc-embedded

On Tuesday, 14 December 2004 11:33 AM, wd@denx.de wrote:

> Dear Andrew,
>=20
> in message <002a01c4e16e$34451010$4000a8c0@CAT> you wrote:
>>=20
>> I posted a question on cardbus with the 5200 a few weeks ago but got
>> no reply. I think the reason is that cardbus / pcmcia support may
>> not have been considered when the 5200 PCI memory map was laid out,
>> but I would love to be contradicted!
>=20
> I think I can confirm that this was not considered, but I'm not  sure
> that this is an issue here.

Hi Wolfgang,

It's a problem for PCMCIA, but probably not for cardbus. The PCMCIA =
16bit
I/O space can't be mapped above 0x1000 in the PCI address space. The CPU
physical address doesn't matter.

The PCMCIA memory space can be mapped to any 16MiB boundary so this =
isn't
a problem

>=20
>> I also have a few outstanding issues that I haven't resolved yet,
>> hence I haven't posted a full patch, but I can now load and
>> configure a wireless ethernet card. Loading cardbus drivers
>> currently fails when accessing PCI configuration space on the
>> cardbus bus, and I haven't sorted this out yet.=20
>=20
> I'd like to see your patch (even if preliminary).

I'll work on bundling it up in the next day or two. There are lots of
changes, including partial support for IRQ0 being a valid interrupt...
sigh. The setup of the BAT for MBAR also doesn't seem correct to me, but
I'm now using io_block_mapping() in my platform support.

Another problem I noticed is pcibios trashing the 5200 bridge setup. =
I've
hacked around this for now. Not a problem for PCMCIA but would have =
broken
bus mastering for cardbus / PCI.

While looking at PCI I noticed that the icecube platform (which I =
copied:)
compiles in pci_auto and indirect_pci but they aren't used. Is this work
in progress or a "cut-n-paste" error?

> Unfortunately I don't have any hardware yet with  a  working  cardbus
> interface. But this might change soon...

Good to hear:)

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

* RE: Lite5200 and PCI1520 - preliminary patch
  2004-12-14  0:32   ` Wolfgang Denk
  2004-12-14  1:25     ` Andrew Dennison
@ 2004-12-17  7:11     ` Andrew Dennison
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Dennison @ 2004-12-17  7:11 UTC (permalink / raw)
  To: wd, 'Zeitler, Nathan'; +Cc: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

On Tuesday, 14 December 2004 11:33 AM, wd@denx.de wrote:
> 
> I'd like to see your patch (even if preliminary).
> 

Well - here it is.

This is a patch against Denx linuxppc_2_4_devel, LABEL_2003_12_22_1500.
Yes - I know that's old but I have some RTAI modules and I didn't want to
jump kernel versions just yet.

All problems I've fixed are still in the top of CVS anyway. Some changes
I've made are backported from or inspired by later 2.4 and 2.6 kernels.

Current status:
orinoco_cs cards work for me
ide_cs fails registering the driver.
some cardbus cards enumerate and can dump_cis, others cause a TEA on
insertion. May be hardware or software bugs:)
card status and functional interrupts sometimes don't work on boot.
IRQ = 0 not supported, may just change mpc5xxx_pci to start interrupts at
1 as fixing this is a lot of work, and all the same assumptions still
exist in 2.6:(
lots of debug rubbish still present

Issues addressed:
1) remap PCI addresses to make PCMCIA feasible
2) use io_block_mapping for MBAR, so pci configuration type 0 cycles are
on a valid memory address after init
3) fix pci configuration type 1 cycles as per errata
4) add PCI1520 support, with interrupt related fixes
5) added preliminary support for my hardware. Most (all?) of the
deviations from idecube in the vpc platform are required for PCMCIA

If anyone has a cardbus pci card that works in a lite5200 and wants to do
some testing I can patch the icecube platform.

I would appreciate some feedback on this!

Andrew

[-- Attachment #2: vpc_patch.2.gz --]
[-- Type: application/x-gzip, Size: 16529 bytes --]

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

end of thread, other threads:[~2004-12-17  7:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-13 22:09 Lite5200 and PCI1520 Zeitler, Nathan
2004-12-13 23:48 ` Andrew Dennison
2004-12-14  0:32   ` Wolfgang Denk
2004-12-14  1:25     ` Andrew Dennison
2004-12-17  7:11     ` Lite5200 and PCI1520 - preliminary patch Andrew Dennison
  -- strict thread matches above, loose matches on Subject: below --
2004-12-14  0:06 Lite5200 and PCI1520 Zeitler, Nathan
2004-12-14  0:45 ` Andrew Dennison
2004-12-13 17:50 Zeitler, Nathan
2004-12-13 21:13 ` 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).