ioread32 returns 0xffffffff; pci driver
I am writing a driver for a pci card. The pci card has got a powerspan II on it as a pci bridge.
The configuration space contains 4096 bytes:
The driver was working properly with ioread32 before. but now it gives me a problem.
I am copying the following lines relevant to the configuration of pci
np = kmalloc(sizeof(struct my_dev), GFP_KERNEL);
if (!np) {
result = -ENOMEM;
printk(KERN_ALERT "mydev registered1");
}
printk(KERN_ALERT "mydev registered");
memset(np, 0,sizeof(struct my_dev));
init_MUTEX(&np->sem);
if (!pci_enable_device(pdev))
printk(" device enabled \n");
if(request_mem_region(pci_resource_start(pdev,1),4096,"pci_skel"));
printk("device given memory\n");
pci_set_drvdata(pdev, np);
np->base_addr=ioremap(pci_resource_start(pdev,1),4096);
iowrite32( 0x00000000,np->base_addr+0x004);
t= ioread32(np->base_addr + 0x004);
printk(KERN_DEBUG " yhu %x: %x",np->base_addr, t);
When I write 0 to 0x004 and read it back it returns 0xffffffff
Could comeone help me otu here please.
I am using fedora core 2 , kernel 2.6.13
Thanks,
N
|