lkml.org 
[lkml]   [1998]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectPCI vremap on ALPHA

Does mmapping memory on PCI cards work on ALPHA?

I use 2.0.35 with alpha-patches-2.0.34-0.1.gz on an 533MHz 21164a LX Board.

$cat /proc/pci
Bus 0, device 9, function 0:
Unknown class: Unknown vendor Unknown device (rev 0).
Vendor id=1093. Device id=14f0.
Medium devsel. Fast back-to-back capable. IRQ 19. Master Capable. Latency=32.
Non-prefetchable 32 bit memory at 0x9000000.
Non-prefetchable 32 bit memory at 0x9001000.


Using the appended kernel module, I get an oops during insmod.

The readl from asm/pyxis.h is

extern inline unsigned long __readl(unsigned long addr)
{
return *(volatile unsigned int * ) (addr + ((0xfffffc0000000000UL) + 0x8600000000UL) );
}

so I am probably doing something stupid, since there the value is wrapped
(0xfffffe0000032000 + ((0xfffffc0000000000UL) + 0x8600000000UL) = fffffa8600032300.

==============================================================================================
physical address0 at 0x9000000
virtual address0 at 0xfffffe0000032000
Unable to handle kernel paging request at virtual address fffffa8600032300
insmod(4091): Oops 0
pc = [<fffffe000002e0e0>] ps = 0000
rp = [<fffffe000002e0c8>] sp = fffffc000dfa9e78
r0=28 r1=fffffc8600000000 r2=8 r3=fffffc000fc897f8
r8=fffffc0000438e70
r16=fffffc0000438e60 r17=0 r18=19 r19=1
r20=f r21=0 r22=0 r23=fffffc000041255c
r24=f r25=10 r26=fffffe000002e0c8 r27=fffffc000031b1f8
r28=0 r29=fffffe0000036170 r30=fffffc000dfa9e78
Code: 203ffc86 48241721 41210409 <a2290000> a61d8030 a77d8020 6b5b4238 27ba0001 23bd8080

=============================================================================================
#define MODULE
#define __KERNEL__
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/bios32.h>
#include <linux/pci.h>
#include <linux/mm.h>
#include <asm/io.h>


#if LINUX_VERSION_CODE < 0x020100
#define ioremap vremap
#define iounmap vfree
#endif


int init_module(void)
{
unsigned char pci_bus, pci_device_fn;
unsigned int address0;
unsigned int address1;
unsigned int erg;

char * virtual_address0;

pcibios_find_device(0x1093, 0x14f0, 0, &pci_bus, &pci_device_fn);

pcibios_read_config_dword(pci_bus, pci_device_fn,
PCI_BASE_ADDRESS_0, &address0);


address0 &= PCI_BASE_ADDRESS_MEM_MASK;

virtual_address0 = ioremap(0xfb000000, 0x2000);


printk("physical address0 at 0x%x\n", address0);
printk(" virtual address0 at 0x%lx\n", (long) virtual_address0);

erg = readl(virtual_address0 + 0x300);

printk("erg: %d\n",erg);

return 0;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.061 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site