Hi,

I try to port a DOS program under rtl but I've a problem to map a pci
memory :

On my pci acquisition board I've got 0x20000 bytes of DPRAM, 0x40000
bytes for a table, 0x20 bytes for Timer and 2 for a status register.

under /proc/pci I can see the physical adress of this four regions :

       Bus  0, device   9, function  0:
      Keyboard controller: AMCC Unknown device (rev 0).
      Vendor id=10e8. Device id=5920.
      Medium devsel.  Fast back-to-back capable.  IRQ 10.
      I/O at 0xf000 [0xf001].
      Non-prefetchable 32 bit memory at 0xffac0000 [0xffac0000].
      Non-prefetchable 32 bit memory at 0xffabffc0 [0xffabffc0].
      Non-prefetchable 32 bit memory at 0xffabffb0 [0xffabffb0].
      Non-prefetchable 32 bit memory at 0xffa00000 [0xffa00000].

when I init my module I request this regions like this :

int init_piraq(void)
{
  u32 val;
  struct pci_dev * dev = NULL;

  printk("\nStarting Real Time Piraq II module\n");
  dev = pci_find_device(PIRAQ_VENDOR,PIRAQ_ID, dev);
  if (dev == NULL) {
    printk("No Piraq board installed\n");
    return (-1);
  }

  pci_read_config_dword (dev,0x20,&val);
  LOOKUP =  ioremap(val,(u32)0x40000);
#ifdef DEBUG
  printk("@LOOKUP = 0x%x %x\n",LOOKUP,val);
#endif
  if(check_region(*LOOKUP,0x40000)) {
    printk("Piraq Lookup Table is locked by someone else\n");
  }
  request_region(*LOOKUP,0x40000,"PII_lookup");

  pci_read_config_dword (dev,0x14,&val);
  PII_DPRAM = ioremap(val,(u32)0x20000);
#ifdef DEBUG
  printk("@DPRAM = 0x%x %x\n",PII_DPRAM,val);
#endif
  if(check_region(*PII_DPRAM,0x20000)) {
    printk("Piraq Dpram is locked by someone else\n");
  }
  request_region(*PII_DPRAM,0x20000,"PII_dpram");

  pci_read_config_dword (dev,0x18,&val);
  TIMER = ioremap(val,(u32)0x40);
#ifdef DEBUG
  printk("@TIMER = 0x%x %x\n",TIMER,val);
#endif
  if(check_region(*TIMER,0x40)) {
    printk("Piraq Timer is locked by someone else\n");
  }
  request_region(*TIMER,0x40,"PII_Timer");

  pci_read_config_dword (dev,0x1C,&val);
  STATUS =  ioremap(val,(u32)0x02);
#ifdef DEBUG
  printk("@STATUS = 0x%x %x\n",STATUS,val);
#endif
  if(check_region(*STATUS,0x02)) {
    printk("Piraq Status is locked by someone else\n");
  }
  request_region(*STATUS,0x02,"PII_Status");
}

All the printk provide the following result :

Aug 15 20:36:58 kernel: Starting Real Time Piraq II module
Aug 15 20:36:58 kernel: created RT-thread
Aug 15 20:36:58 kernel: @LOOKUP = 0xc2a5a000 ffa00000
Aug 15 20:36:58 kernel: Piraq Lookup Table is locked by someone else
Aug 15 20:36:58 kernel: @DPRAM = 0xc2a9b000 ffac0000
Aug 15 20:36:58 kernel: @TIMER = 0xc2abcfc0 ffabffc0
Aug 15 20:36:58 kernel: @STATUS = 0xc2abefb0 ffabffb0
Aug 15 20:36:58 kernel: Piraq II board found at 0xf001 interrupt 0xa

Under /proc/ioports I can see all my request except the one for the
LOOKUP.

If I decrease the size of the LOOKUP to some thing very small I can
make the request.

Do you have any solution ????

I can allocate all the LOOKUP size with djgpp.

Thank in advance

Fred Cazenave

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to