Subject: Re: Adding a disk to a shark
To: Todd Vierling <tv@pobox.com>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 10/09/1998 18:08:25
This is a multipart MIME message.

--==_Exmh_-1664459680
Content-Type: text/plain; charset=us-ascii


tv@pobox.com said:
> : Something I forgot to mention in my first message was that the Aug28
> build  : of the firmware does not contain an interrupts property for
> the ide device  : (I had to fake this up in the ofw probing code using
> the constant defined  : in the headers -- I'll submit a patch once I
> get all this sorted out).   : Could this be related to why I can't
> access the disk ?  Can I patch my  : firmware to supply this info?

> Hm.  The attach code is supposed to handle that with COMPAT_OLD_OFW,
> but perhaps it didn't.... 


I think it got lost in the big rewrite or whatever it was.  The code in 
wdc_ofisa_machdep assumes that the hardware will return the required 
interrupt, but just set the value of the share field incorrectly.  In fact 
old firmware doesn't supply any interrupt at all, so you get the message 
"error getting interrupt data" and no disk, which is what other people 
have been reporting.  I've enclosed the patch below; if someone can get 
this installed it would be great.

Richard.


--==_Exmh_-1664459680
Content-Type: application/x-patch ; name="wdc.patch"
Content-Description: wdc.patch
Content-Disposition: attachment; filename="wdc.patch"

Index: wdc_ofisa_machdep.c
===================================================================
RCS file: /xx/rearnsha.old/netbsd/usr/cvs/src/sys/arch/arm32/ofw/wdc_ofisa_machdep.c,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 wdc_ofisa_machdep.c
*** wdc_ofisa_machdep.c	1998/05/12 18:29:14	1.1.1.1
--- wdc_ofisa_machdep.c	1998/09/30 10:14:58
*************** wdc_ofisa_md_intr_fixup(parent, self, au
*** 77,85 ****
  	int ndescs, ndescsfilled;
  {
  
! 	if (1)			/* XXX old firmware compat enabled */
! 	if (ndescs > 0 && ndescsfilled > 0)
!                 descp[0].share = IST_LEVEL;
  	return (ndescsfilled);
  }
  
--- 77,91 ----
  	int ndescs, ndescsfilled;
  {
  
! 	if (1) {		/* XXX old firmware compat enabled */
! 		if (ndescs > 0 && ndescsfilled > 0)
! 			descp[0].share = IST_LEVEL;
! 		else if (ndescs > 0 && ndescsfilled < 0) {
! 			descp[0].share = IST_LEVEL;
! 			descp[0].irq = IRQ_IDE;
! 			return 1; /* We have faked one up */
! 		}
! 	}
  	return (ndescsfilled);
  }
  

--==_Exmh_-1664459680--