[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: IO Question



Hi,
Here I list the things to do to access I/O space & memory space:

I/O Space:
1. Bar0 lowest 2 bits should be hardwired internally to "01" indicating
Bar0 space is related to I/O space; (PCI 2.2 page:202)
2. If you ask for 256 bytes for I/O space, implement a register of bit31
- bit8 to receive I/O address. When first being written with value of
x"FFFFFFFF", then being read, your Bar0 will return value of
x"FFFFFF01", indicating that the space needs 256Bytes and should be
allocated in I/O space. The next write from boot subsystem will write a
correct value to Bar0, the final I/O space address.

It is booting subsystem's responsibility to allocate I/O space address.
If you, a user, allocates its address, the address may have been already
allocated to other device and when accessing the address, other device
of the address will have output competing with your device, making none
workable.

I don't know how your device is configured before SYSTEM BOOT. Refer its
manual and it may give you right answer to resolve the above problem:
you may have control the Bar0 content before SYSTEM BOOT, not after it
if the chip you are using can be re-configured in the field.

Memory Space is same as I/O space with a little difference. See PCI 2.2
page:202.

Weng

-----Original Message-----
From: Rob Clark [mailto:clark@erlang-software.com] 
Sent: Sunday, October 20, 2002 11:09 PM
To: pci-sig@znyx.com
Subject: IO Question


All,

I am building single chip WWW server based on a PCI NE2000 card. As
such..I have no OS or PCI controller chip....just a PIC micro connected
straight to the PCI bus.

The following is working perfectly:

- CONFIG READ
- CONFIG WRITE
I can read and set the various config registers...including the BARs. In
my card, BAR0 requests 256 IO addresses and BAR1 requests 256 MEM
addresses. I have set these BARs as follows BAR0 (io) =  00001000
BAR1 (mem)=  00001000   (ie same...but this should not matter??)

and I have set the CONFIG_COMMAND register to have the CMD_IO_SPACE and
CMD_MEM_SPACE bits set (all others off)

But...this is NOT working;
- IO READ
- MEM READ
In an NE2000, a read from (IO_BASE_ADDR + 00) or (MEM_BASE_ADDR+00)
should give me the NE2000 COMMAND register. In fact...I get the
hardwired MAC address for the card (ie from the on board EPROM)

So...I can not workout why I am getting back address 00 from the EPROM
instead of address 00 from the normal registers.

Ideas??

Rob