Linux 2.6 PCI Device Driver on Virtex 4

I have spent the past few months slowly trying to get a PCI design with Linux 2.6 on the Virtex 4. I have been able to overcome some of the hurdles; however, I am still unable to boot up a working system. If anyone has tried to do this (or has already done this) I would apprecaite any help or suggestions. I can go into more detail as to what I have done and where I am stuck if there is anyone who would be willing to guide me!

Thanks, Bin

Reply to
bin.arthur
Loading thread data ...

Are you using MicroBlaze or PPC?

Have you verified PCI functionality with low level test apps - ie do a standalone EDK application that executes a PCI scan, make sure you can see the configuration space, do some simple config setup and try to move some data around.

If that's all working, then in Linux the PPC kernel uses more or less mainline PPC PCI handling code - you just need to do have some Xilinx-specific setup to enable the bridge, and you also need to tweak the config_read and _write routines to only do word accesses.

Post on the linuxppc-embedded list to tap into the right channel.

Regards,

John

Reply to
John Williams

On Mar 27, 8:03 pm, John Williams wrote:

I am using PPC.

I first downloaded a "hello_pci" standalone application from Xilinx website. I test my PCI-PCI Bridge and South Bridge and read device ID and vendor ID back. Xilinx's application note #945 has inspired me a lot. I did not try to move any data around because I have no idea how to do that. :-)

After that, I implemented Xilinx's board support package including xparameter head file, ml410 early boot files, pci support files, Board initialization file, did board specific setup, and fixed some bugs in its call tree, which took me almost a month.

I have attached my booting message in this mail. As you can see, I am stuck at "[ 11.805382] Freeing unused kernel memory: 100k init" . Usually it's the last step before the kernel starts root file system. I am sure my ramdisk and root file system were both working OK. My naive thought is that the kernel could not register serial port successfully (see time stamp [ 5.965954]). As a result, ttyS0 was not able to run and display messages after starting ramdisk. I would appreciate any help or suggestions on this.

It's also interesting to see my ml410 board respond me with a "ml300" id. My booting message was saying: pci_scan: bus 0, device 8, id 030010ee "10ee" is the vendor id for xilinx while "300" is the device id which I think might represent ml300. Does Xilinx forget to refresh its rom?

I am about to do that :-)

Here is my environment and tools:

-- Xilinx ML410 Rev C

-- Xilinx EDK 9.2i

-- Secret lab Linux v2.6 originally configured as platform Xilinx ML403

And my booting message:

--------------------------------------------------------------------------- Xilinx ML410 Board-Specific Initialization:

ppb_init: dev = 9, id = ac23104c pci_scan: bus 0, device 1, id 545110b9 pci_scan: bus 0, device 2, id 153310b9 pci_scan: bus 0, device 3, id 545710b9 pci_scan: bus 0, device 8, id 030010ee pci_scan: bus 0, device 9, id ac23104c pci_scan: bus 0, device 12, id 710110b9 pci_scan: bus 0, device 15, id 523710b9 sio_init: Device ID = 53 15, Revision = f3. sio_init: LPT1 base = 0x0378, irq = 5. sio_init: COM1 base = 0x03f8, irq = 4. sio_init: COM2 base = 0x02f8, irq = 3. sio_init: KBC irq = 1, PS2 irq = 1. sio_init: Super I/O initialization complete.

loaded at: 00400000 006C21B4 board data at: 006C0124 006C01A0 relocated to: 00405154 004051D0 zimage at: 00406215 004EFDAA initrd at: 004F0000 006BFDB0 avail ram: 006C3000 08000000

Linux/PPC load: console=ttyS0,9600 ip=off root=/dev/ram Uncompressing Linux...done. Now booting the kernel [ 0.000000] Linux version 2.6.23-rc2-g0d62d8a8-dirty (bhuang2@rsass- homer.uncc.edu) (gcc version 4.2.1) #190 Thu Mar 28 [ 0.000000] Xilinx ML40x Reference System (Virtex-4 FX) [ 0.000000] Port by MontaVista Software, Inc. ( snipped-for-privacy@mvista.com) [ 0.000000] Zone PFN ranges: [ 0.000000] DMA 0 -> 32768 [ 0.000000] Normal 32768 -> 32768 [ 0.000000] Movable zone start PFN for each node [ 0.000000] early_node_map[1] active PFN ranges [ 0.000000] 0: 0 -> 32768 [ 0.000000] Built 1 zonelists in Zone order. Total pages: 32512 [ 0.000000] Kernel command line: console=ttyS0,9600 ip=off root=/ dev/ram [ 0.000000] Xilinx INTC #0 at 0x41200000 mapped to 0xE7FED000 [ 0.000000] PID hash table entries: 512 (order: 9, 2048 bytes) [ 0.000175] Console: colour dummy device 80x25 [ 0.000241] console [ttyS0] enabled [ 1.382947] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) [ 1.466045] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) [ 1.572643] Memory: 125852k available (1480k kernel code, 496k data, 100k init, 0k highmem) [ 1.764350] Mount-cache hash table entries: 512 [ 1.827727] PCI: Probing PCI hardware [ 1.906477] ppc405_map_irq: bus 0 idsel 1 pin 1, res = 31 [ 1.970528] ppc405_map_irq: bus 0 idsel 2 pin 1, res = 31 [ 2.035157] ppc405_map_irq: bus 0 idsel 3 pin 1, res = 31 [ 2.099646] ppc405_map_irq: bus 0 idsel 8 pin 1, res = 31 [ 2.164225] ppc405_map_irq: bus 0 idsel 9 pin 1, res = 31 [ 2.228787] ppc405_map_irq: bus 0 idsel 11 pin 1, res = 31 [ 2.294400] ppc405_map_irq: bus 0 idsel 12 pin 1, res = 31 [ 2.360031] ppc405_map_irq: bus 0 idsel 15 pin 1, res = 31 [ 2.441645] SCSI subsystem initialized [ 2.487503] usbcore: registered new interface driver usbfs [ 2.553907] usbcore: registered new interface driver hub [ 2.617790] usbcore: registered new device driver usb [ 2.687574] checking if image is initramfs...it isn't (no cpio magic); looks like an initrd [ 4.548936] Freeing initrd memory: 1855k freed [ 4.606889] io scheduler noop registered [ 4.653232] io scheduler anticipatory registered (default) [ 4.718790] io scheduler deadline registered [ 4.769907] io scheduler cfq registered [ 4.815634] Activating ISA DMA hang workarounds. [ 5.667502] 0000:00:0f.0 OHCI: BIOS handoff failed (BIOS bug ?) ffffffff [ 5.798505] Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled [ 5.892194] serial8250: ttyS0 at MMIO 0x0 (irq = 12) is a 16550A [ 5.965954] Couldn't register serial port 0000:00:03.0: -28 [ 6.044910] RAMDISK driver initialized: 16 RAM disks of 65536K size

1024 blocksize [ 6.141529] loop: module loaded [ 6.178422] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 [ 6.254522] ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx [ 6.351314] ALI15X3: IDE controller at PCI slot 0000:00:0b.0 [ 6.418510] ALI15X3: chipset revision 196 [ 6.466414] ALI15X3: 100% native mode on irq 31 [ 6.520489] ALI15X3: simplex device: DMA forced [ 6.574602] ide0: BM-DMA at 0xdfd0-0xdfd7, BIOS settings: hda:DMA, hdb:DMA [ 6.660918] ALI15X3: simplex device: DMA forced [ 6.715201] ide1: BM-DMA at 0xdfd8-0xdfdf, BIOS settings: hdc:DMA, hdd:DMA [ 9.054991] usbmon: debugfs is not available [ 9.106161] mice: PS/2 mouse device common for all mice [ 9.168819] ali15x3_smbus 0000:00:0c.0: ALI15X3_smb region uninitialized - upgrade BIOS or use force_addr=0xaddr [ 9.290327] ali15x3_smbus 0000:00:0c.0: ALI15X3 not detected, module not inserted. [ 9.383605] RAMDISK: Compressed image found at block 0 [ 11.704980] VFS: Mounted root (ext2 filesystem) readonly. [ 11.805382] Freeing unused kernel memory: 100k init ................kernel stops here................

---------------------------------------------------------------------------

regards,

Bin

Reply to
bin.arthur

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.