SCSI on PMC - Please Help!

SCSI on PMC - Please Help!

Post by David Garne » Fri, 21 Aug 1998 04:00:00



vxWorks Gurus,

First let me apologize for the lengthy post.  We are trying to implement a
scsi PMC
card manufactured by Technobox Inc. into the MV2604 PowerPC.  The scsi
controller has
been installed into the PMC site located on the base board and the dip
switches have
been set as follows:
 INT-A
 TERM-ENAB
 Little Endian
Another VME card (Phoenix International) with two scsi hard disks at ID 3 &
4 have been
installed into slot 2 and a 64 to 50-pin cable connects the controller to
the drive card.
The scsi controller has a SYMBIOS 53C875 chip and I've been told by Wind
River that
the controller on the base board and its libraries are compatible with it.
I've
attempted to make changes to the kernel so that the PMC scsi will be
initialized
instead of the base board scsi.  I probed the device to extract the
device/vendor
info and made the appropriate addition to mv2600.h.  Listed below are all
the changes
I've made to the kernel.  sysScsiInit runs successfully (no error messages)
but
sysScsiConfig hangs.  I know that there are many more commands to issue to
make a
dos FS but I'm not at that point yet. Would someone familiar with vxworks
and scsi
please tell me what I'm missing.

Thanks in advance,
Dave Garner
Lockheed Martin Federal Systems
david.gar...@lmco.com

config.h:
========================================================================

#define    SCSI_PMC
#define    EXTENDED_VME
#define INCLUDE_PRIMARY_SCSI    /* NCR 825 */
#undef  INCLUDE_SECONDARY_SCSI  /* [NOT AVAILABLE] */
#define    INCLUDE_SCSI
#undef  SCSI_AUTO_CONFIG        /* scan bus on startup */
#undef  SCSI_WIDE_ENABLE        /* enable wide SCSI on MVME761-011 only */
#undef  SYS_SCSI_CONFIG         /* call sysScsiConfig in sysScsi.c */

mv2600.h:
=======================================================================

#define PCI_ID_SCSI             0x00031000      /* Id for SYM53C825/75 Chips
*/
#define PCI_ID_TECHNOBOX_SCSI   0x000f1000      /* Id for Technobox PMC */
#ifdef  SCSI_PMC
#define SCSI_DEV_SPACE          0x40000         /* Technobox controller in PMC site
*/
#else
#define SCSI_DEV_SPACE          0x10000         /* baseboard scsi controller */
#endif

sysLib.c:
sysHwInit():
========================================================================

#ifdef INCLUDE_SCSI
    /*
     *  Initialize the Standard PCI Header of the SCSI device if present
     */
#ifdef SCSI_PMC
     /* controller on pmc */
     if ((DEVICE_PRESENT(MV2600_BMFR_SCIP) == TRUE) &&
         (pciFindDevice ((PCI_ID_TECHNOBOX_SCSI & 0xFFFF), (PCI_ID_TECHNOBOX_SCSI

>> 16) & 0xFFFF,

                         0, &pciBusNo, &pciDevNo, &pciFuncNo) != ERROR))
       {
         (void)pciDevConfig (pciBusNo, pciDevNo, pciFuncNo,
                             PCI_IO_SCSI_ADRS,
                             NULL,
                             (PCI_CMD_MASTER_ENABLE | PCI_CMD_IO_ENABLE));
       }
     else
       {
#endif
         /* controller on base board */
         if ((DEVICE_PRESENT(MV2600_BMFR_SCIP) == TRUE) &&
             (pciFindDevice ((PCI_ID_SCSI & 0xFFFF), (PCI_ID_SCSI >> 16) & 0xFFFF,
                             0, &pciBusNo, &pciDevNo, &pciFuncNo) != ERROR))
           {
             (void)pciDevConfig (pciBusNo, pciDevNo, pciFuncNo,
                                 PCI_IO_SCSI_ADRS,
                                 NULL,
                                 (PCI_CMD_MASTER_ENABLE | PCI_CMD_IO_ENABLE));
           }
#ifdef SCSI_PMC
       }
#endif
#endif /* INCLUDE_SCSI */

sysScsi.c:
========================================================================

STATUS sysScsiInit () /* called from tRootTask */
    {
    int                   pciBusNo;
    int                   pciDevNo;
    int                   pciFuncNo;
    UINT16                devType;
    static BOOL              firstTime = TRUE;

    /* Local structure(s) with a prefill for ncr825SetHwRegister */

    static NCR810_HW_REGS hwRegs  = MV2600_SIOP_HW_REGS;

    /* Set CPU <-> PCI address offset */

    ncr810PciMemOffset = PCI2DRAM_BASE_ADRS;

    /*
     * Since the PCI bus is little endian, and the PPC CPU's are big endian,
     * the ncr8xx scripts need to be byte swapped in memory. However, they
     * should only be swapped the first time that sysScsiInit() is invoked.

     */

    scsiDebug = TRUE;
    SCSI_DEBUG_MSG ("Initializing SCSI controller\n", 0,0,0,0,0,0);
    if (firstTime)
        {
        swapScript ((UINT32 *) &ncr810Wait, (UINT32 *)
                    ((UINT32) &ncr810Wait +
                     (UINT32)(NCR810_INSTRUCTIONS * 8)));
        firstTime = FALSE;
        }
    /*
     * Try to automatically configure the correct type of NCR8XX controller.
     * The only options are the NCR825 and NCR810 controller.
     */

    /* DRG 08-18-98 Added Technobox SCSI controller */
    if (pciFindDevice ((PCI_ID_TECHNOBOX_SCSI & 0xFFFF),
(PCI_ID_TECHNOBOX_SCSI >> 16) & 0xFFFF,
                       0, &pciBusNo, &pciDevNo, &pciFuncNo) != ERROR)
        {
        SCSI_DEBUG_MSG ("Found a SYMBIOS 53C875 Controller\n", 0,0,0,0,0,0);
        }
    else if (pciFindDevice ((PCI_ID_NCR825 & 0xFFFF), (PCI_ID_NCR825 >> 16)
& 0xFFFF,
                       0, &pciBusNo, &pciDevNo, &pciFuncNo) != ERROR)
        {
        SCSI_DEBUG_MSG ("Found an NCR825 Controller\n", 0,0,0,0,0,0);
        }
    else if (pciFindDevice ((PCI_ID_NCR810 & 0xFFFF),
                            (PCI_ID_NCR810 >> 16) & 0xFFFF, 0, &pciBusNo,
                            &pciDevNo, &pciFuncNo) != ERROR)
        {
        SCSI_DEBUG_MSG ("Found an NCR810 Controller\n", 0,0,0,0,0,0);
        }
    else
        {
        logMsg ("SCSI controller not found\n", 0, 0, 0, 0, 0, 0);
        return (ERROR);
        }
    pciConfigInWord (pciBusNo,          /* bus number */
                     pciDevNo,          /* device number */
                     pciFuncNo,         /* function number */
                     PCI_CFG_DEVICE_ID, /* offset into the configuration space */
                     &devType);             /* data read from the offset */

#ifndef SCSI_WIDE_ENABLE
    devType = NCR810_DEVICE_ID;
#endif
    ncr810DelayCount = NCR810_DELAY_MULT;

    /* Create the SCSI controller */

    if ((pSysScsiCtrl = (SCSI_CTRL *) ncr810CtrlCreate
                                          (
                                          (UINT8 *) SCSI_BASE_ADRS,
                                          (UINT)    NCR810_40MHZ,
                                                    devType
                                          )) == NULL)
        {
        SCSI_DEBUG_MSG ("ERROR: Can not create SCSI controller\n", 0, 0, 0, 0, 0,
0);
        return (ERROR);
        }

    /* connect the SCSI controller's interrupt service routine */

    if (intConnect (INUM_TO_IVEC (SCSI_INT_VEC),
                    ncr810Intr, (int) pSysScsiCtrl) == ERROR)
        {
        SCSI_DEBUG_MSG ("ERROR: Can not connect the SCSI controller's ISR\n", 0, 0,
0, 0, 0, 0);
        return (ERROR);
        }
    /* Enable SCSI interrupts */
    intEnable (SCSI_INT_LVL);
    /* initialise SCSI controller with default parameters (user tuneable) */
    if (ncr810CtrlInit ((NCR_810_SCSI_CTRL
*)pSysScsiCtrl,SCSI_DEF_CTRL_BUS_ID) == ERROR)
      {
        SCSI_DEBUG_MSG ("ERROR: Can not initialize the SCSI controller\n", 0, 0, 0,
0, 0, 0);
        return (ERROR);
      }
#if (USER_D_CACHE_MODE &  CACHE_SNOOP_ENABLE)
    scsiCacheSnoopEnable ((SCSI_CTRL *) pSysScsiCtrl);
#else
    scsiCacheSnoopDisable ((SCSI_CTRL *) pSysScsiCtrl);
#endif
    /*
     * Set the good value in the registers of the SIOP coupled
     * with the hardware implementation
     */
    if (ncr810SetHwRegister ((NCR_810_SCSI_CTRL *)pSysScsiCtrl, &hwRegs)
        == ERROR)
      {
        SCSI_DEBUG_MSG ("ERROR: ncr810SetHwRegister failed\n", 0, 0, 0, 0, 0, 0);
        return(ERROR);
      }
    return (OK);
    }

sysScsi.c:
========================================================================

STATUS sysScsiConfig (void)
    {
    /* configure a SCSI hard disk at scsi busId = 3, LUN = 0 */
    scsiDebug = TRUE;           /* enable SCSI debugging output */
    if ((pSpd20 =
         scsiPhysDevCreate (pSysScsiCtrl, /* ptr to SCSI controller info */
                            3,            /* device's SCSI bus ID */
                            0,            /* device's logical unit number */
                            0,            /* length of REQUEST SENSE data dev returns */
                            NONE,         /* type of SCSI device */
                            0,            /* whether medium is removable */
                            0,            /* number of blocks on device */
                            0)            /* size of a block in bytes */
         )
        == (SCSI_PHYS_DEV *) NULL)
        {
        printErr ("usrScsiConfig: scsiPhysDevCreate failed.\n",
                        0, 0, 0, 0, 0, 0);
        }
    else
        {
        /* create block devices */
        if ((pSbd0 = scsiBlkDevCreate (pSpd20,    /* pScsiPhysDev,   ptr to
SCSI physical device info */
                                       32*2048,   /* numBlocks,      32*2048=32Meg number of blocks in
block device */
                                       0          /* blockOffset     address of first block in volume */
                                       )) == NULL)
            {
            return (ERROR);
            }

        if ((dosFsDevInit("/sd3/", pSbd0, NULL) == NULL) )
            {
            return (ERROR);
            }
        }
    return (OK);
    }

Press any key to stop auto-boot...
 0
auto-booting...

boot device          : dc
processor number     : 0
host name            : vxhost
file name            : /opt/wind_ppc/wip/vxWorks.st
inet on ethernet (e) : 9.34.242.108:ffffff00
inet on backplane (b): 9.242.108.1:ffffff00
host inet (h)        : 9.34.200.23
gateway inet (g)     : 9.34.242.253
user (u)             : vxworks
ftp password (pw)    :
flags (f)            : 0x8
target name (tn)     : scsi_test

Attaching network interface dc0... done.
Attaching network interface lo0... done.
Loading... 1117140
Starting at 0x100000...

0x1fffe08 (tRootTask): Initializing SCSI controller
0x1fffe08 (tRootTask): Found a SYMBIOS 53C875 Controller
Attaching network interface dc0... done.
Initializing backplane net with anchor at 0x4100... done.
Backplane anchor at 0x4100... Attaching network interface sm0... done.
Attaching network interface lo0... done.

Adding 3478 symbols for standalone.

 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
      ]]]]]]]]]]]  ]]]]     ]]]]]]]]]]       ]]              ]]]]
(R)
 ]     ]]]]]]]]]  ]]]]]]     ]]]]]]]]       ]]               ]]]]
 ]]     ]]]]]]]  ]]]]]]]]     ]]]]]] ]     ]]                ]]]]
 ]]]     ]]]]] ]    ]]]  ]     ]]]] ]]]   ]]]]]]]]]  ]]]] ]] ]]]]  ]]   ]]]]
]
 ]]]]     ]]]  ]]    ]  ]]]     ]] ]]]]] ]]]]]]   ]] ]]]]]]] ]]]] ]]   ]]]]
 ]]]]]     ]  ]]]]     ]]]]]      ]]]]]]]] ]]]]   ]] ]]]]    ]]]]]]]    ]]]]
 ]]]]]]      ]]]]]     ]]]]]]    ]  ]]]]]  ]]]]   ]] ]]]]    ]]]]]]]]    ]]]
]
 ]]]]]]]    ]]]]]  ]    ]]]]]]  ]    ]]]   ]]]]   ]] ]]]]    ]]]] ]]]]    ]]
]]
 ]]]]]]]]  ]]]]]  ]]]    ]]]]]]]      ]     ]]]]]]]  ]]]]    ]]]]  ]]]] ]]]]
]
 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]       Development System
 ]]]]]]]]]]]]]]]]]]]]]]]]]]]]
 ]]]]]]]]]]]]]]]]]]]]]]]]]]]       VxWorks version 5.3.1
 ]]]]]]]]]]]]]]]]]]]]]]]]]]       KERNEL: WIND version 2.5
 ]]]]]]]]]]]]]]]]]]]]]]]]]       Copyright Wind River Systems, Inc.,
1984-1997

                               CPU: Motorola MVME2600 - MPC 604e.  Processor
#0.
                              Memory Size: 0x2000000.  BSP version
1.1/4.04-BBD
                             WDB: Ready.

-> sysScsiConfig
0x17b85d0 (tShell): scsiReqSense:
0x17b85d0 (tShell): scsi2Transact:
0x17d82b8 (tScsiTask): scsiMgrRequestProc: client request: 0
0x17d82b8 (tScsiTask): scsiMgrActivateRequest: thread 0x01ffde98
0x17d82b8 (tScsiTask): ncr810ThreadActivate: thread 0x01ffde98: activating
0x17d82b8 (tScsiTask): ncr810XferParamsCvt: requested: offset = 255, period
= 25
0x17d82b8 (tScsiTask): ncr810XferParamsCvt: converted to: offset     = 8,
period      = 25
xferParams = 8, clockDivide = 19
0x17d82b8 (tScsiTask): ncr810XferParamsCvt: converted to: offset     = 0,
period      = 0
xferParams = 0, clockDivide = 3
0x17d82b8 (tScsiTask): ncr810ThreadStateSet: thread 0x01ffde98: 1 -> 6
0x17d82b8 (tScsiTask): scsiMgrTimeoutProc: thread 0x01ffde98 (state = 6)
timed out
0x17d82b8 (tScsiTask): ncr810ThreadAbort: thread 0x01ffde98 (state = 6)
aborting
0x17d82b8 (tScsiTask): ncr810ThreadStateSet: thread 0x01ffde98: 6 -> 9

At this point the target shell hangs.  A Control-C will restart the shell.

Any help would be appreciated.

vxworks tornado

 
 
 

1. MV2400 SCSI PCI PMC

Hello All,

I am trying to compile SCSI support into an mv2400 Power PC board.
I can't seem to find the sysScsi.c file in the board support package.
I have seen some mention that the mv2400 does not support SCSI, but
we have a PMC card installed to handle that issue.  Has anybody
had a similiar problem or know a solution?

Thanks,

Glen

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. DJ1200c & Micrografx Picture Publisher

3. VueScan 7.5.50 / OS X 10.2.1 / Canon fs4000 (scsi) - PLEASE HELP!

4. A1200 Floppy Problems

5. Umax 1200S SCSI scanner..please help

6. SQL scripts as background processes on NT

7. Epson 1200 Scanner/Scsi install nightmare-help please??

8. wanted: GIF-reader !!!

9. Scanner/SCSI/Laptop problems. Help please

10. Help please Scanner/SCSI/Laptop

11. SCSI and scanner questions PLEASE HELP!!!

12. Windows 98 won't work with my HP IIcx (scsi) Help, Please !

13. Acerscan with SCSI, please help me out..:(