Changeset 174 for trunk


Ignore:
Timestamp:
Nov 10, 2013, 4:56:20 PM (12 years ago)
Author:
David Azarewicz
Message:

Fix for hardware that reports incorrect status.
Now report both real and fake devices when SCSI emulation is enabled.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/Makefile

    r171 r174  
    3030# Define default build version if not specified in environment
    3131BLD_MAJOR=1
    32 BLD_MINOR=31 # must be 2 digits
     32BLD_MINOR=32 # must be 2 digits
    3333BLD_REV=0 # not used at this time
    3434FIXPACK=
     
    5858!endif
    5959
    60 CC_INCLUDE = -I..\include &
    61              -I$(DDK)\base\h &
    62              -I$(DDK)\base\ibmh &
    63              -I$(DDK)\base\src\dev\dasd\diskh &
    64              -I$(DDK)\base\src\dev\thinkpad\dockii\apmcalls &
    65 
    66 AS_INCLUDE = -I=$(DDK)\base\inc &
    67              -I=$(DDK)\base\src\dev\dasd\diskinc
    68 
    69 LIB_DIRS   = $(DDK)\base\lib\ &
    70              $(DDK)\base\src\dev\dasd\devhlp\ &
    71              $(DDK)\base\src\dev\thinkpad\dockii\apmcalls\
     60AS_INCLUDE = -I=$(DDK)\base\inc
     61LIB_DIRS = $(DDK)\base\lib\
    7262
    7363###############################################################################
     
    7969#
    8070
    81 %PATH=..\..\tools;$(WATCOM)\BINP;$(WATCOM)\BINW;
    82 AS     = wasm
    83 CC     = wcc
    84 MAPSYM = $(DDK)\base\tools\mapsym.exe
     71%INCLUDE=..\include;$(DDK)\base\h;
     72%PATH=..\..\tools;$(WATCOM)\BINP;$(WATCOM)\BINW;$(DDK)\base\tools;
     73AS=wasm
     74CC=wcc
     75MAPSYM=mapsym.exe
    8576
    8677!ifdef __LOADDLL__
     
    160151
    161152.c.obj: .autodepend
    162     $(CC) $(CFLAGS) $(CC_INCLUDE) $[@
     153    $(CC) $(CFLAGS) $[@
    163154    #wdis -l $^@
    164155
  • trunk/src/os2ahci/README

    r173 r174  
    88
    99OS2AHCI is an AHCI driver for eComStation. It supports both ATA and
    10 ATAPI devices in a single driver, thus there's no need for an
    11 ATAPI/CDROM filter driver.
     10ATAPI devices in a single driver. An ATAPI/CDROM filter driver is
     11only required if you want to read/write CD-DA (audio) format CDs.
    1212
    1313
     
    4343=========================
    4444
    45 The *binary* delivery of OS2AHCI.ADD as obtained from ecomstation.nl,
     45The *binary* delivery of OS2AHCI.ADD as obtained from the BetaZone,
    4646or as part of packaged eComStation releases, is licensed to run with
    4747eComStation only.
     
    5353
    5454Please note that builds other than the official binary delivered as
    55 part of eComStation releases or downloaded from ecomstation.nl are
    56 not officially supported by Mensys.
     55part of eComStation releases or downloaded from the BetaZone are
     56not officially supported.
    5757
    5858
     
    6262The toolchain required for compilation consists of:
    6363
    64  - IBM OS/2 DDK version 9.23 or later (see ddk\base\h\version.mak)
    65    and that has been updated for SMP systems. (Used for include files)
    66  - Open Watcom C/C++ package
    67    (available from: http://www.openwatcom.org/index.php/Downloads)
    68  - WCC 16-bit C Compiler (part of the Open Watcom package)
    69  - WASM Assembler (part of the Open Watcom package)
    70  - WLINK Linker (part of the Open Watcom package)
    71  - MAPSYM (part of the DDK)
     64 - The MiniDDK or an updated DDK
     65 - Open Watcom version 1.9 or later
    7266
    7367Define DDK and WATCOM in the environment.
     
    358352the character device named "IBMS506$", they will not work with OS2AHCI unless
    359353modified to open the OS2AHCI$ device. Previous versions of OS2AHCI used to
    360 register a duplicate device with the IBMS506$ name, however since
    361 that caused so many unacceptable problems, that is no longer done. You must
    362 have a SMART utility that opens the OS2AHCI$ device to access the AHCI driver.
     354register a duplicate device with the IBMS506$ name, however since that caused
     355so many unacceptable problems, that is no longer done. You must have a SMART
     356utility that opens the OS2AHCI$ device to access the AHCI driver.
    363357
    364358A patched version of the smartctl.exe program is included in the OS2AHCI
     
    393387Change Log
    394388==========
     389
     390v.1.32 09-Nov-2013 - David Azarewicz
     391  Fix for some hardware that reports incorrect status
     392  Report real device in addition to fake SCSI device when SCSI emulation
     393    is enabled.
    395394
    396395v.1.31 21-Aug-2013 - David Azarewicz
  • trunk/src/os2ahci/ahci.c

    r171 r174  
    315315    /* more ports in port_map than in HOST_CAP & 0x1f */
    316316    ports = ai->hw_ports;
    317     dprintf("implemented port map (0x%lx) contains more "
    318             "ports than nr_ports (%d), using nr_ports\n",
    319             ai->port_map, ports);
     317    dprintf("implemented port map (0x%lx) contains more ports than nr_ports (%d), using nr_ports\n", ai->port_map, ports);
    320318    ai->port_map = (1UL << ports) - 1UL;
    321319  }
     
    347345  readl(ai->mmio + HOST_CTL);
    348346
    349   if ((ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN) == 0 &&
    350       ai->pci_vendor == PCI_VENDOR_ID_INTEL) {
     347  if ((ai->bios_config[HOST_CTL / sizeof(u32)] & HOST_AHCI_EN) == 0 && ai->pci_vendor == PCI_VENDOR_ID_INTEL) {
    351348
    352349    /* This BIOS apparently accesses the controller via SATA registers and
     
    410407}
    411408
     409#ifdef NOT_USED
    412410int ahci_reset_controller(AD_INFO *ai)
    413411{
     
    416414
    417415    dprintf("controller reset starting on adapter %d\n", ad_no(ai));
    418     /* we must be in AHCI mode, before using anything
    419      * AHCI-specific, such as HOST_RESET.
    420      */
     416
     417    /* we must be in AHCI mode, before using anything AHCI-specific, such as HOST_RESET. */
    421418    ahci_enable_ahci(ai);
    422419
     
    445442    ahci_enable_ahci(ai);
    446443
    447     /* Some registers might be cleared on reset.  Restore
    448      * initial values.
    449      */
     444    /* Some registers might be cleared on reset.  Restore initial values. */
    450445    ahci_restore_initial_config(ai);
    451446
     
    465460    return 0;
    466461}
     462#endif
    467463
    468464/******************************************************************************
     
    769765  writel(port_mmio + PORT_SCR_ERR, tmp);
    770766
    771   /* power up and spin up the drive if necessary */
    772   if (((tmp = readl(port_mmio + PORT_CMD)) & (PORT_CMD_SPIN_UP|PORT_CMD_POWER_ON)) != (PORT_CMD_SPIN_UP|PORT_CMD_POWER_ON)) {
    773     writel(port_mmio + PORT_CMD, tmp | PORT_CMD_SPIN_UP | PORT_CMD_POWER_ON);
    774   }
     767  /* Some hardware reports incorrect status so just set these bits unconditionally */
     768  tmp = readl(port_mmio + PORT_CMD);
     769  tmp &= ~PORT_CMD_ALPE; /* turn off agressive power management */
     770  tmp |= (PORT_CMD_SPIN_UP | PORT_CMD_POWER_ON); /* power up and spin up the drive */
     771  writel(port_mmio + PORT_CMD, tmp);
    775772
    776773  /* set link speed and power management options */
     
    13091306    rc = timer_check_and_block(&Timer);
    13101307    if (rc) {
    1311       dprintf(" Timeout", tmp);
     1308      dprintf(" Timeout");
    13121309      break;
    13131310    }
    13141311  }
    13151312
    1316   if ((tmp = readl(port_mmio + PORT_SCR_ERR)) != 0) {
     1313  tmp = readl(port_mmio + PORT_SCR_ERR);
     1314  if (tmp & PORT_ERR_FAIL_BITS) {
    13171315    dprintf(" SERR = 0x%08lx", tmp);
    13181316    rc = 1;
  • trunk/src/os2ahci/ahci.h

    r162 r174  
    182182                                 PORT_IRQ_PIOS_FIS | PORT_IRQ_D2H_REG_FIS)
    183183
     184#define PORT_ERR_X              (1UL << 26) /* Exchanged */
     185#define PORT_ERR_FIS            (1UL << 25) /* Unknown FIS type */
     186#define PORT_ERR_TP             (1UL << 24) /* Transport State Transition Error */
     187#define PORT_ERR_S              (1UL << 23) /* Link Sequence Error */
     188#define PORT_ERR_H              (1UL << 22) /* Handshake Error */
     189#define PORT_ERR_CRC            (1UL << 21) /* CRC Error */
     190#define PORT_ERR_D              (1UL << 20) /* Disparity Error */
     191#define PORT_ERR_B              (1UL << 19) /* 10B to 8B Decode Error */
     192#define PORT_ERR_W              (1UL << 18) /* Comm Wake */
     193#define PORT_ERR_PI             (1UL << 17) /* Phy Internal Error */
     194#define PORT_ERR_N              (1UL << 16) /* PhyRdy Change */
     195#define PORT_ERR_IE             (1UL << 11) /* Internal Error */
     196#define PORT_ERR_P              (1UL << 10) /* Protocol Error */
     197#define PORT_ERR_C              (1UL << 9)  /* Persistent Communication or Data Integrity Error */
     198#define PORT_ERR_TD             (1UL << 8)  /* Transient Data Integrity Error */
     199#define PORT_ERR_M              (1UL << 1)  /* Recovered Communications Error */
     200#define PORT_ERR_DI             (1UL << 0)  /* Recoverred Data Integrity Error */
     201#define PORT_ERR_FAIL_BITS      (PORT_ERR_X | PORT_ERR_FIS | PORT_ERR_TP | PORT_ERR_S | PORT_ERR_H | PORT_ERR_CRC | \
     202                                 PORT_ERR_D | PORT_ERR_B | PORT_ERR_W | PORT_ERR_PI | PORT_ERR_IE | PORT_ERR_P | \
     203                                 PORT_ERR_C | PORT_ERR_TD)
     204
    184205/* PORT_CMD bits */
    185206#define PORT_CMD_ASP            (1UL << 27) /* Aggressive Slumber/Partial */
  • trunk/src/os2ahci/os2ahci.c

    r171 r174  
    10721072          if (ad_info->ports[p].devs[d].present) {
    10731073            if (ad_info->ports[p].devs[d].atapi && emulate_scsi[dta][p]) {
    1074               /* only report this unit as SCSI unit */
     1074              /* report this unit as SCSI unit */
    10751075              scsi_units++;
    1076               continue;
     1076              //continue;
    10771077            }
    10781078            if (add_unit_info(iorb_conf, dta, dta, p, d, 0)) {
     
    11011101        for (p = 0; p <= ad_info->port_max; p++) {
    11021102          for (d = 0; d <= ad_info->ports[p].dev_max; d++) {
    1103             if (ad_info->ports[p].devs[d].present &&
    1104                 ad_info->ports[p].devs[d].atapi &&
    1105                 emulate_scsi[a][p]) {
     1103            if (ad_info->ports[p].devs[d].present && ad_info->ports[p].devs[d].atapi && emulate_scsi[a][p]) {
    11061104              if (add_unit_info(iorb_conf, dta, a, p, d, scsi_id++)) {
    11071105                goto iocm_device_table_done;
     
    14461444 * separate function which is invoked via a context hook.
    14471445 */
    1448 void _cdecl _far timeout_callback(ULONG timer_handle, ULONG p1,
    1449                                   ULONG p2)
     1446void _cdecl _far timeout_callback(ULONG timer_handle, ULONG p1, ULONG p2)
    14501447{
    14511448  IORBH _far *iorb = (IORBH _far *) p1;
     
    15021499 * problems during the early boot phase.
    15031500 */
    1504 void _cdecl _far reset_watchdog(ULONG timer_handle, ULONG p1,
    1505                                 ULONG p2)
     1501void _cdecl _far reset_watchdog(ULONG timer_handle, ULONG p1, ULONG p2)
    15061502{
    15071503  /* reset watchdog timer */
  • trunk/src/os2ahci/pci.c

    r171 r174  
    931931  }
    932932
    933   dddphex(parm, sizeof(*parm), "oemhlp_parm: ");
    934   dddphex(data, sizeof(*data), "oemhlp_data: ");
     933  //dddphex(parm, sizeof(*parm), "oemhlp_parm: ");
     934  //dddphex(data, sizeof(*data), "oemhlp_data: ");
    935935
    936936  if (ioctl.rph.Status & STERR) {
  • trunk/tools/update.cmd

    r156 r174  
    11/* Update the driver */
     2call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs';
     3call SysLoadFuncs;
    24parse arg BootDrive;
    35
Note: See TracChangeset for help on using the changeset viewer.