Analog Devices EE207 Application Notes

Engineer To Engineer Note EE-207
a
Technical Notes on using Analog Devices' DSP components and development tools
Contact our technical support by phone: (800) ANALOG-D or e-mail: dsp.support@analog.com Or visit our on-line resources http://www.analog.com/dsp and http://www.analog.com/dsp/EZAnswers
Using the ADSP-BF535 Blackfin® processor's PCI interface in Device Mode
Contributed by Jorge Manguane September 10, 2003

Introduction

The purpose of this document is to familiarize the user with the ADSP-BF535 Blackfin® Processor’s Peripheral Component Interconnect (PCI) interface in Device mode. This document describes how to program the PCI interface to function in Device mode.
For the remainder of this document, “processor” will refer to “ADSP-BF535 Blackfin® processor.”
The BF535 includes a 3.3V Revision 2.2­compliant, 33 MHz, 32-bit PCI bus interface. The interface can act as either a PCI Host or as a PCI Device. The BF535 can master the PCI bus in both Host and Device modes. In addition, a dedicated bus is available on chip to allow an external bus master to transfer data directly to internal (L2 memory) or external memory spaces of the processor.
Device Mode:
to have this information stored in its boot code. The PCI specification rev. 2.2 stipulates that a device has up to 2
25
PCI clock cycles to initialize its PCI configuration register space. The processor’s PCI core interface will issue retries if a system host tries to access the device’s configuration space before the processor has enabled the PCI interface (which is done by writing a 1 to the “PCI Enable” bit in the PCI Control Register (PCI_CTL)). It is, therefore, imperative not to set the “PCI Enable” bit until all configuration registers have been initialized.
An external PCI clock must be supplied
L
to the BF535 PCI module before attempting to access the PCI Configuration registers since these reside in the PCI clock domain.
The ADSP-BF535 EZ-Kit Lite evaluation board does not bring out the PCI signals, and PCI Clock is not provided.
The processor’s PCI interface supports a single­function PCI device and can be interfaced gluelessly to 3.3 Volt systems.
BF535 based PCI boards for both host and device applications are available from Momentum Data Systems at: http://www.mds.com
When a PCI device is plugged into a system, the PCI host needs to gather some information about the device that will allow the host to configure the device and load the proper device driver. Since this information exchange happens at power up or after system reset, the device needs
Copyright 2003, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of customers’ products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property of their respective holders. Information furnished by Analog Devices Applications and Development Tools Engineers is believed to be accurate and reliable, however no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices’ Engineer-to-Engineer Notes.
(128
)
a
Figure 1. Type 0 PCI Configuration space Header region
Device ID Vendor ID
Status Register Command Register
Class Code Revision ID
BIST Header
Type
BAR 0 (Memory BAR)
BAR 2 (I/O BAR)
CardBus CIS Pointer
Subsystem ID Subsystem Vendor ID
Expansion ROM Base Address
Reserved Capabilities
Latency
Timer
BAR 1
BAR 3
BAR 4
BAR 5
Reserved
Cache Line
Size
Pointer
Listing 1, in the Appendix, shows an example program of how to initialize the PCI interface in device mode.
PCI Transaction Types:
There are three types of PCI transactions:
1. Configuration Accesses
2. Memory Accesses
3. I/O Accesses
In device mode the BF535 PCI core responds to all of the transaction types listed above. Note, however, that the processor’s architecture does not define separate Configuration and I/O address spaces. The three PCI memory spaces are mapped into the processor’s unified memory region. Refer to Figure 2, which shows a subset of the processor’s external memory map.
Figure 2. PCI Address spaces
Maximum
Latency
Minimum
Grant
Interrupt
Pin
Interrupt
Line
Figure 1 shows the PCI configuration registers implemented on the BF535 PCI interface as specified by the PCI Local Bus Specification, Revision 2.2. This document should be consulted for a detailed description of these registers.
Cache Line Size and Built-In Self Test (BIST) registers are implemented but not supported by
the processor. The remaining registers, shown shaded in gray, are not implemented.
This register space is referred to as the device’s configuration header region or space. The format of the BF535 PCI header region is Header Type Zero, which is used for all devices other than PCI-to-PCI and CardBus bridges.
0xEEFF FFFF
0xEEFF FFFC
0xEEFF FF00
0xEEFE FFFF
0xEEFE 0000
0xE7FF FFFF
0xE000 0000
PCI Memory Map:
PCI Config Space Port (4 bytes) PCI Config Space Port (4 bytes)
PCI Config Registers ( 64 KB)
RESERVED
PCI IO SPACE (64KB)
RESERVED
PCI Memory Space
MB
Using the ADSP-BF535 Blackfin® processor's PCI interface in Device Mode (EE-207) Page 2 of 9
a
I/O accesses can be used to access the processor’s non-prefetchable Memory Mapped Register (MMR) space.
The processor can initiate Memory and I/O accesses, but never Configuration accesses, while in Device mode. Configuration accesses are always initiated by the system host.
To respond to Configuration accesses, the processor need only initialize its configuration registers and then enable the PCI interface. After this, the host system can configure the PCI device. The host assigns to the device the following parameters:
¾ The capabilities of the device, such as Bus
Mastership, Parity Error Response, Special Cycles, etc… This information is written into the processor’s PCI_CFG_CMD register .
Please refer to the processor’s hardware reference manual for a description of this register and of the remaining registers mentioned below.
¾ Latency timer, the minimum amount of time
the PCI device master can retain ownership of the bus when it initiates a transaction. This information is written into the processor’s PCI_CFG_MLT register
¾ Unique Memory and I/O addresses. This
information is written into the processor’s
PCI_CFG_MBAR and PCI_CFG_IBAR
registers. The values in these registers will
allow the device to respond, by asserting its Device Select line (#DEVSEL), to any accesses that fall within the range specified by the value in PCI_CFG_xBAR offset by the value in the corresponding mask register,
PCI_CFG_MBARM or PCI_CFG_IBARM
for memory and I/O, respectively.
For example, if
PCI_CFG_MBAR = 0xE000 0000 and
PCI_CFG_MBARM = 0xFFFC 0000
(which corresponds to a size of
0x0003 FFFF+1 = 0x0004 0000)
then the ADSP-BF535 PCI core will claim all transactions that fall in the range:
0xE000 0000 to 0xE004 0000
In the above example, note that the host calculates the memory size required by the device by taking a 1’s complement of the value in PCI_CFG_MBARM and adding a 1 to the result. Likewise, for I/O size the operation described above is also performed on the value in PCI_CFG_IBARM register.
¾ Interrupt line information written into
the processor’s PCI_CFG_IL register
Device is now ready to participate in PCI transactions as either a target or as an initiator.
OUTBOUND TRANSACTIONS
Outbound transactions are those transactions for which the BF535 PCI interface is the bus master. The following registers are used to perform outbound transactions:
PCI Outbound Memory Base Address Register (PCI_MBAP) for memory
accesses
and the
PCI Outbound I/O Base Address Register (PCI_IBAP) for I/O accesses.
MEMORY ACCESSES:
To initiate a memory access, the device writes to the PCI_MBAP register the uppermost 5 bits (31:27) of the intended destination address. These 5 bits will be prefixed to the 27-bit offset of the actual address in the PCI memory space.
Using the ADSP-BF535 Blackfin® processor's PCI interface in Device Mode (EE-207) Page 3 of 9
Loading...
+ 6 hidden pages