From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,7e930b7d42ecea7,start X-Google-Attributes: gid111c93,public From: John Ward Subject: Alpha and PCI Driver (w/ mmap) problems ... Date: 2000/05/10 Message-ID: <391958A4.4D5D66C7@cfl.rr.com>#1/1 X-Deja-AN: 621542804 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@rr.com X-Trace: typhoon.tampabay.rr.com 957962366 24.95.239.179 (Wed, 10 May 2000 08:39:26 EDT) Organization: RoadRunner - Central Florida MIME-Version: 1.0 NNTP-Posting-Date: Wed, 10 May 2000 08:39:26 EDT Newsgroups: comp.os.linux.alpha I have a "simple" PCI card that has a memory region which is mmap'able ... so I wrote a driver which identifies the card with the pci_find_device() call, and then mmap's the information out of the appropriate base address using the following call: remap_page_range(vma->vm_start, (vma->vm_offset + g_offset), (vma->vm_end - vma->vm_start), vma->vm_page_prot); Anyhow, I have a corresponding application program that simply opens the device and then prints out the contents of a mmap'd region: fd = open("/dev/truetime", O_RDWR)); ptr = mmap(0, MAX_DEV_MEM_SIZE, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0); etc ... Problem is that on my alpha system I get all 0's ... nada ... zilch. BUT when I run it on our Intel/Linux systems it works just fine. I can see the data changing, set some registers, etc ... The only thing I did differently on the alpha system was add a flag to my compile code: "-ffixed-8" ... otherwise I got some weird error, actually this error: ------------------------------------------------------ In file included from /usr/include/asm/semaphore.h:11, from /usr/include/linux/fs.h:164, from truetime.c:9: /usr/include/asm/current.h:4: global register variable follows a function definition /usr/include/asm/current.h:4: warning: call-clobbered register used for global register variable ------------------------ So the -ffixed-8 seemed to fix this ... don't know if it's causing another problem or not ... I've tried various compile flags, I can read all of the PCI configuration registers using either setpci or my driver itself, but I just can't seem to get at the data, I print out the address returned from my mmap call and it matches the same virtual memory address that I get inside my driver, so technically I should be pointed to the correct address space ... SO, anybody with experience writing Alpha/Linux device drivers ... could you offer any suggestions? Here's some basic system specs: RH Linux, kernel 2.2.15 w/ SMP support, on Compaq ES40 system. In addition here's a little more of the PCI information: % lspci -vv ... ... ... 01:03.0 Bridge: PLX Technology, Inc. PCI <-> IOBus Bridge (rev 01) Subsystem: True Time Inc.: Unknown device 5900 Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR-