AlteraPCI

Table of contents
No headers

This is a sample design for Nios II with Altera PCI host bridge to connect external PCI devices (such as WiFi,GigaLAN?, etc). It uses the SOPC Builder flow in the PCI Compiler. The sample design uses external PCI clock, and internal bus arbitor to support up to two external PCI masters. The SDRAM on Avalon bus can be accessed by the external masters. A simple external interrupt wrapping module, "irqn", is used to connect interrupts from external devices to the Nios II CPU. 
Follow the user guide to add PCI timing constraints with the TCL file.

If you are new to PCI, read the book "PCI System Architecture" from MindShare.

You should configure and enable dev0, bar0 for external PCI devices to access the SDRAM, e.g. base addr 0. 

The CPU accesses the PCI slave via PCI_Bus_Access base address - defined in the PCI toolbench (Avalon Configuration tab). They are divided into Configuration, I/O, Memory space 1 and 2, each of 1Mbytes.

#define pcicfg_space (na_pci_compiler_0_PCI_Bus_Access) // Avalon space
#define pciio (pcicfg_space+0x100000) // PCI I/O device base in Avalon space
#define pcimm (pcicfg_space+0x200000) // PCI mem device base in Avalon space
// idsel of ad11=dev0,ad12=dev1 , using type 0 config request
#define pcicfg(dev,fun,reg) (pcicfg_space | ((dev)<<11) | ((fun)<<8) | (reg)) // configuration space

You must assign the address translation table in the Altera PCI core toolbench (Avalon configuration tab). We use the same address mapping (to/from PCI) so that the PCI auto config code can work. After you add the PCI bridge component, find out the PCI bus access address assignment in SOPC Builder. Next, edit the PCI bridge component again. Remember to "uncache" the access.
eg, PCI bridge Avalon base is 0x02000000, uncache -> 0x82000000,
row 0,  PCI config space, PCI base 0, avalon 0x82000000
row 1, PCI io space, PCI base 0x82100000, avalon 0x82100000
row 2, PCI mem space, PCI base 0x82200000, avalon 0x82200000
row 3, unused

Wire Connection Lists

(note: the suffix of the PCI pin names are omitted and the Nios II CPU with PCI core is just called "cpu"):

Connect the IDSEL with resistive couple. CPU's DRAM will be device0.
1. ad[11] -- 330R -- IDSEL of CPU (or it can be internal connected in the CPU)
2. ad[12] -- 330R -- IDSEL of PCI device 1
3. ad[13] -- 330R -- IDSEL of PCI device 2

Connect the IRQ lines:
1. the inta of CPU, no connect
2. each int of PCI devices connect to a irqn input

Connect the req/gnt pairs from each PCI devices to CPU
PCI clock should match length.
Other signals are bussed.
Add pull-up to all signals, except for AD.
PAR needs pull-down.

Attached is the sample PTF and Verilog design file for a Cyclone II.

dev0 is sdram,
dev1 is your pci device1, using irqn_0 to irqn_3 for inta..intd
dev2 is your pci device2, using irqn_4 to irqn_7 for inta..intd
(update the number of irqn in the example design to 8)

PCI Driver

The PCI driver is in the attached altpci.zip, which is included in uClinux-dist already.
You have to update arch/nios2nommu/drivers/pci/altpci.c to fix PCI slot and IRQ mappings for your board. Search for "FIX ME".

In kernel config,

Processor type and features -->
--- Platform drivers Options
[*] Altera PCI host bridge

Note, you cannot use NDIS wrapper because the code are x86 objects and cannot run on a Nios II.


Some Altera Nios dev boards have 32 bits PMC connectors, and you can use them with adaptors.
What is PMC? (with schematic drawings)
A PCI to PMC adaptor  

  

Tag page

Files 2

FileSizeDateAttached by 
 altpci.zip
No description
14.85 kB02:17, 8 Dec 2008AdminActions
 pcisample.zip
No description
43.36 kB02:17, 8 Dec 2008AdminActions
Viewing 1 of 1 comments: view all
Nice story about this.
Great Nice Pictures
causes back pain knee high shoes lizlange maternity fishing boats sale flu incubation period remedies sore throat cost breast implants muscle weight gain surgery breast reduction girls party ideas women laptop bags car brake parts continuing nursing education cost breast augmentation protein whey powder baby slings carriers bed bugs pictures bedding duvet covers phone pay as you go outdoor swing sets discount dinnerware sets coffee espresso machines salton yogurt maker hair color pictures pictures of haircuts asvab practice test herpes photos easy cooking recipes toy dog breeds herpes simplex 1 personalized dog tags stress fracture foot occupational therapy schools frontline plus cats fleas on humans physical therapy salary scabies pictures pictures of shingles what is blood pressure ibuprofen side effects pictures of ringworm gendongan bayi kain cukin ring sling pouch sling perlengkapan bayi selendang bayi nursing cover selendang baby perlengkapan bayi baru lahir bayi bayi lucu foto bayi parish vintage ebooks download tv series download manga free download make money online health information cell phone review disorders anxiety psat practice test blood preasure smart water filter filter pur water weight loss effects blood pressure side effects socks over knee socks dress Hot News Today Jual Beli Make Money Celebrity Gossip Kesehatan Alternatif Gosip Selebritis celebrity photos celebrity news hot celebrities celebrity blog kesehatan info kesehatan kesehatan kerja pelayanan kesehatan indonesia artis foto artis gambar artis selebriti iklan iklan gratis jual online handphone daily news breaking news local news online news food dehydrator tray massage chair ijoy homedics massage shiatsu evening gown dress evening wedding dress dry face skin gold toe sock window coverings blinds blinds for windows lip gloss cosmetics folding table chairs women high heels stockings high heels treatment of pain chlorine generation makeup lighted mirror pain management specialist lawn pest control garden pest control joint pain causes
Posted 16:09, 20 Jul 2010
Viewing 1 of 1 comments: view all
You must login to post a comment.
SourceForge.net