Changeset 31


Ignore:
Timestamp:
Sep 30, 2010, 11:50:09 AM (15 years ago)
Author:
markus
Message:

display error if device claimed by other driver; update BIOS MMIO address if resource manager rejects it; ICH5 does NOT support AHCI -> removed

Location:
trunk/src/os2ahci
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/os2ahci.def

    r27 r31  
    11library os2ahci
    2 Description '$@#thi.guten (www.thiguten.de):1.00.20100924#@OS/2 AHCI Adapter Device Driver'
     2Description '$@#thi.guten (www.thiguten.de):1.00.20100930#@OS/2 AHCI Adapter Device Driver'
    33protmode
    44
  • trunk/src/os2ahci/os2ahci.h

    r27 r31  
    217217#define PCI_VENDOR_ID_CT       0x102c
    218218#define PCI_VENDOR_ID_INTEL    0x8086
     219#define PCI_VENDOR_ID_INITIO   0x1101
    219220#define PCI_VENDOR_ID_JMICRON  0x197B
    220221#define PCI_VENDOR_ID_MARVELL  0x11ab
  • trunk/src/os2ahci/pci.c

    r14 r31  
    161161PCI_ID pci_ids[] = {
    162162
    163   /* Intel */
     163  /* Intel
     164   * NOTE: ICH5 controller does NOT support AHCI, so we do
     165   *       not add it here! */
    164166  { PCI_VDEVICE(INTEL, 0x2652), board_ahci }, /* ICH6 */
    165167  { PCI_VDEVICE(INTEL, 0x2653), board_ahci }, /* ICH6M */
     
    602604
    603605  ret = RMAllocResource(rm_drvh, &ad_info->rm_irq, &resource);
    604   if (ret != RMRC_SUCCESS) {
    605     cprintf("error: couldn't register IRQ %d (rc = %d)\n", irq, ret);
    606     return;
     606  switch (ret) {
     607    case RMRC_SUCCESS:
     608      break;
     609    case RMRC_DEV_ALREADY_CLAIMED:
     610    case RMRC_RES_ALREADY_CLAIMED:
     611      cprintf("warning: device already claimed by other driver\n");
     612      return;
     613    default:
     614      cprintf("error: couldn't register IRQ %d (rc = %d)\n", irq, ret);
     615      return;
    607616  }
    608617  rc_list->hResource[rc_list->NumResource++] = ad_info->rm_irq;
     
    663672
    664673    ret = RMAllocResource(rm_drvh, &ad_info->rm_mmio, &resource);
     674
     675    if (ret == RMRC_SUCCESS) {
     676      /* MT: got a new address from Resource Manager; now we
     677       * need to tell the BIOS about the new address.
     678       * Leave the last 4 bits of the original MMIO value alone.
     679       */
     680      mmio_bios = (mmio_bios & 0x0000000fUL) |
     681        (resource.MEMResource.MemBase & 0xfffffff0UL);
     682      ddprintf("address we got from RM: 0x%08lx\n",
     683               resource.MEMResource.MemBase);
     684      ddprintf("setting new MMIO BIOS addr to 0x%08lx\n", mmio_bios);
     685
     686      if (pci_write_conf(bus, dev_func, AHCI_MMIO,
     687                         sizeof(u32), mmio_bios) != OH_SUCCESS) {
     688        /* failed to update BIOS MMIO address - bail out */
     689        cprintf("error: couldn't update BIOS MMIO address\n");
     690        ret = ~RMRC_SUCCESS;
     691        goto add_pci_fail;
     692      }
     693
     694    }
    665695  }
    666696
Note: See TracChangeset for help on using the changeset viewer.