Okay, I give up. How *do* you use ioremap()?

Ingles, Raymond (Ray.Ingles@fanucrobotics.com)
Sun, 14 Nov 1999 01:45:26 -0500


I'm working on a driver for the "enhanced game port" mode of
some soundcards. (Basically they take over polling the joystick
so the CPU doesn't have to.) I've got it working for a Trident
4Dwave card, now I'm working on the Aureal Vortex 1 & 2.

I managed to get hold of a Vortex 2 for the weekend. I've been
testing my code, which I developed by reading Rubini's "Linux
Device Drivers", following threads on linux-kernel, and perusing
code, e.g. the acenic driver.

The problem is ioremap(). I don't have to do it for the 4DWave,
it uses I/O ports and inb, etc., are good enough. The Vortex
uses memory-mapped I/O, however, and I can't get that working.

Here's the relevant portion of the code:

----------------------
/* Get base address to read card values */
pci_read_config_dword(pci_p, 0x10, &info->reg_base);
printk(KERN_WARNING "joy-pci: reg_base 1: %x\n",
info->reg_base);

info->reg_base = pci_p->base_address[0];
printk(KERN_WARNING "joy-pci: using reg_base of %x\n",
info->reg_base);

info->mem_base = ioremap(info->reg_base,
JS_PCI_VORTEX_MEM_SIZE);

printk(KERN_WARNING "joy-pci: ioremapped, mem_base is %p\n",
info->mem_base);

/* Disable legacy game port. */
regval = readl(info->mem_base + JS_PCI_VORTEX2_LEGACY_CR);
writel(regval & ~0x8,
info->mem_base + JS_PCI_VORTEX2_LEGACY_CR);

printk(KERN_WARNING "joy-pci: disabled analog port\n");

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

Here's the sad output I get:

----------------------
joy-pci: reg_base 1: de000000
joy-pci: using reg_base of de000000
joy-pci: ioremapped, mem_base is c806b000
Unable to handle kernel paging request at virtual address c8113030
current->tss.cr3 = 060ea000, %cr3 = 060ea000
*pde = 07fce063
*pte = 00000000
----------------------

So, what the heck am I doing wrong? (This is kernel 2.2.11, if
it matters.) Any suggestions, correction, more information I
can provide? From everything I've read, this ought to work. Why
doesn't it?

(I'd appreciate it if you could CC me. I *am* on the list, but
it's dang hard to read using the Exchange web interface, which
I'll have to do from home.)

Thanks for any help y'all can provide!

Sincerely,

Ray Ingles (248) 377-7735 ray.ingles@fanucrobotics.com

"Is knowledge knowable? If not, how do we know this?" -- Woody Allen

-
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.tux.org/lkml/