Subject: Re: VAX 4000-300 For sale in Melbourne, AUSTRALIA
To: Lord Isildur <mrfusion@uranium.vaxpower.org>
From: Tom Ivar Helbekkmo <tih@catch.no>
List: port-vax
Date: 07/16/2002 09:59:23
Lord Isildur <mrfusion@uranium.vaxpower.org> writes:

> The CMD's do something strange, e.g. there was in older CSRG BSD
> some patch one had to apply to get the bootblocks to boot from CMD
> mscp-scsi controllers too.

Well, that particular bit wasn't too strange.  They just refuse to
lie, and say they've generated an interrupt while (during boot)
interrupts are disabled, and the controller is being operated in a
polled mode.  So, in /sys/vaxstand/uda.c, one has to properly pass
ownership of MSCP datagram containers back and forth between CPU and
controller, for instance by modifying the code like this:

*** uda.c.ORIG	Tue Nov 25 20:10:01 1997
--- uda.c	Tue Nov 25 20:11:50 1997
***************
*** 140,163 ****
  	u->uda1_cmd.mscp_opcode = op;
  	u->uda1_cmd.mscp_msglen = MSCP_MSGLEN;
  	u->uda1_rsp.mscp_msglen = MSCP_MSGLEN;
! 	u->uda1_ca.ca_rspdsc |= MSCP_OWN|MSCP_INT;
! 	u->uda1_ca.ca_cmddsc |= MSCP_OWN|MSCP_INT;
  	i = udaddr[io->i_adapt][io->i_ctlr]->udaip;	/* start uda polling */
  #ifdef lint
  	i = i;
  #endif
  	mp = &u->uda1_rsp;
  	for (;;) {
  		if (u->uda1_ca.ca_cmdint)
  			u->uda1_ca.ca_cmdint = 0;
! 		if (u->uda1_ca.ca_rspint == 0)
  			continue;
  		u->uda1_ca.ca_rspint = 0;
  		if (mp->mscp_opcode == (op | M_OP_END))
  			break;
  		printf("unexpected rsp type %x op %x ignored\n",
  			MSCP_MSGTYPE(mp->mscp_msgtc), mp->mscp_opcode);
! 		u->uda1_ca.ca_rspdsc |= MSCP_OWN | MSCP_INT;
  	}
  	if ((mp->mscp_status&M_ST_MASK) != M_ST_SUCCESS)
  		return (-1);
--- 140,165 ----
  	u->uda1_cmd.mscp_opcode = op;
  	u->uda1_cmd.mscp_msglen = MSCP_MSGLEN;
  	u->uda1_rsp.mscp_msglen = MSCP_MSGLEN;
! 	u->uda1_ca.ca_rspdsc |= MSCP_OWN;
! 	u->uda1_ca.ca_cmddsc |= MSCP_OWN;
! 
  	i = udaddr[io->i_adapt][io->i_ctlr]->udaip;	/* start uda polling */
  #ifdef lint
  	i = i;
  #endif
  	mp = &u->uda1_rsp;
+ 
  	for (;;) {
  		if (u->uda1_ca.ca_cmdint)
  			u->uda1_ca.ca_cmdint = 0;
! 		if (u->uda1_ca.ca_rspdsc & MSCP_OWN)
  			continue;
  		u->uda1_ca.ca_rspint = 0;
  		if (mp->mscp_opcode == (op | M_OP_END))
  			break;
  		printf("unexpected rsp type %x op %x ignored\n",
  			MSCP_MSGTYPE(mp->mscp_msgtc), mp->mscp_opcode);
! 		u->uda1_ca.ca_rspdsc |= MSCP_OWN;
  	}
  	if ((mp->mscp_status&M_ST_MASK) != M_ST_SUCCESS)
  		return (-1);


-tih
-- 
Popularity is the hallmark of mediocrity.  --Niles Crane, "Frasier"