9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] devi82365.c fix
@ 2002-05-28 17:04 Fco.J.Ballesteros
  0 siblings, 0 replies; 3+ messages in thread
From: Fco.J.Ballesteros @ 2002-05-28 17:04 UTC (permalink / raw)
  To: 9fans

Following nigel advice I changed i82365 to set the 3v bit
only for my card type and let my disk work.

I tested it and it seems to work right.

diff /n/dump/2002/0528/sys/src/9/pc/devi82365.c /sys/src/9/pc/devi82365.c
19a20
> 	 Fcard3v=	 (1<<3),
48c50,52
<
---
> 	Rcdgcr=		0x16,		/* Card detect general control register*/
> 	 Fslot1v=	 (1<<6),	/* voltage for slot 1 (0 == 3.3v) */
> 	 Fslot2v=	 (1<<7),	/* voltage for slot 2 (0 == 3.3v) */
95a100
> 	Ti82365SLDF,
173a179,182
> 	uchar   enaval;
> 	I82365* ctlr;
> 	uchar	cdgcr;
>
178c187,196
< 	wrreg(pp, Rpc, Fautopower|Foutena|Fcardena);
---
> 	enaval = Fautopower|Foutena|Fcardena;
> 	ctlr = pp->cp;
> 	if (ctlr->type == Ti82365SLDF){
> 		cdgcr = rdreg(pp, Rcdgcr);
> 		if (pp - slot == 0 && (cdgcr&Fslot1v) == 0)
> 			enaval |= Fcard3v;
> 		if (pp - slot == 1 && (cdgcr&Fslot2v) == 0)
> 			enaval |= Fcard3v;
> 	}
> 	wrreg(pp, Rpc, enaval);
459a478
> [Ti82365SLDF]	"Intel 82365SL-DF",
487a507,509
> 	case 0x84:
> 		cp->type = Ti82365SLDF;
> 		/* has the 3v power bit and is like Ti82365 otherwise */
490d511
< 	case 0x84:
515c536
< 	if(cp->type == Ti82365){
---
> 	if(cp->type == Ti82365 || cp->type == Ti82365SLDF){
901a923,925
> 	uchar cdgcr;
> 	uchar enaval;
> 	I82365* ctlr;
971c995,1006
< 	wrreg(pp, Rpc, x|Fautopower|Foutena|Fcardena);
---
>
> 	enaval = x|Fautopower|Foutena|Fcardena;
> 	ctlr = pp->cp;
> 	if (ctlr->type == Ti82365SLDF){
> 		cdgcr = rdreg(pp, Rcdgcr);
> 		if (slotno == 0 && (cdgcr&Fslot1v) == 0)
> 			enaval |= Fcard3v;
> 		if (slotno == 1 && (cdgcr&Fslot2v) == 0)
> 			enaval |= Fcard3v;
> 	}
>
> 	wrreg(pp, Rpc, enaval);



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] devi82365.c fix
@ 2002-05-28 20:55 presotto
  0 siblings, 0 replies; 3+ messages in thread
From: presotto @ 2002-05-28 20:55 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

I've installed nemo's changes on sources.  Nemo, make sure I got the diffs merged right
and try it out on your card.

[-- Attachment #2: Type: message/rfc822, Size: 2884 bytes --]

From: Fco.J.Ballesteros <nemo@plan9.escet.urjc.es>
To: 9fans@cse.psu.edu
Subject: [9fans] devi82365.c fix
Date: Tue, 28 May 2002 19:04:50 +0200
Message-ID: <1890f95b5b25fd97004929ac451ceae0@plan9.escet.urjc.es>

Following nigel advice I changed i82365 to set the 3v bit
only for my card type and let my disk work.

I tested it and it seems to work right.

diff /n/dump/2002/0528/sys/src/9/pc/devi82365.c /sys/src/9/pc/devi82365.c
19a20
> 	 Fcard3v=	 (1<<3),
48c50,52
<
---
> 	Rcdgcr=		0x16,		/* Card detect general control register*/
> 	 Fslot1v=	 (1<<6),	/* voltage for slot 1 (0 == 3.3v) */
> 	 Fslot2v=	 (1<<7),	/* voltage for slot 2 (0 == 3.3v) */
95a100
> 	Ti82365SLDF,
173a179,182
> 	uchar   enaval;
> 	I82365* ctlr;
> 	uchar	cdgcr;
>
178c187,196
< 	wrreg(pp, Rpc, Fautopower|Foutena|Fcardena);
---
> 	enaval = Fautopower|Foutena|Fcardena;
> 	ctlr = pp->cp;
> 	if (ctlr->type == Ti82365SLDF){
> 		cdgcr = rdreg(pp, Rcdgcr);
> 		if (pp - slot == 0 && (cdgcr&Fslot1v) == 0)
> 			enaval |= Fcard3v;
> 		if (pp - slot == 1 && (cdgcr&Fslot2v) == 0)
> 			enaval |= Fcard3v;
> 	}
> 	wrreg(pp, Rpc, enaval);
459a478
> [Ti82365SLDF]	"Intel 82365SL-DF",
487a507,509
> 	case 0x84:
> 		cp->type = Ti82365SLDF;
> 		/* has the 3v power bit and is like Ti82365 otherwise */
490d511
< 	case 0x84:
515c536
< 	if(cp->type == Ti82365){
---
> 	if(cp->type == Ti82365 || cp->type == Ti82365SLDF){
901a923,925
> 	uchar cdgcr;
> 	uchar enaval;
> 	I82365* ctlr;
971c995,1006
< 	wrreg(pp, Rpc, x|Fautopower|Foutena|Fcardena);
---
>
> 	enaval = x|Fautopower|Foutena|Fcardena;
> 	ctlr = pp->cp;
> 	if (ctlr->type == Ti82365SLDF){
> 		cdgcr = rdreg(pp, Rcdgcr);
> 		if (slotno == 0 && (cdgcr&Fslot1v) == 0)
> 			enaval |= Fcard3v;
> 		if (slotno == 1 && (cdgcr&Fslot2v) == 0)
> 			enaval |= Fcard3v;
> 	}
>
> 	wrreg(pp, Rpc, enaval);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] devi82365.c fix
@ 2002-05-28 20:41 presotto
  0 siblings, 0 replies; 3+ messages in thread
From: presotto @ 2002-05-28 20:41 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 41 bytes --]

sounds good.  If stick it in the sources.

[-- Attachment #2: Type: message/rfc822, Size: 2884 bytes --]

From: Fco.J.Ballesteros <nemo@plan9.escet.urjc.es>
To: 9fans@cse.psu.edu
Subject: [9fans] devi82365.c fix
Date: Tue, 28 May 2002 19:04:50 +0200
Message-ID: <1890f95b5b25fd97004929ac451ceae0@plan9.escet.urjc.es>

Following nigel advice I changed i82365 to set the 3v bit
only for my card type and let my disk work.

I tested it and it seems to work right.

diff /n/dump/2002/0528/sys/src/9/pc/devi82365.c /sys/src/9/pc/devi82365.c
19a20
> 	 Fcard3v=	 (1<<3),
48c50,52
<
---
> 	Rcdgcr=		0x16,		/* Card detect general control register*/
> 	 Fslot1v=	 (1<<6),	/* voltage for slot 1 (0 == 3.3v) */
> 	 Fslot2v=	 (1<<7),	/* voltage for slot 2 (0 == 3.3v) */
95a100
> 	Ti82365SLDF,
173a179,182
> 	uchar   enaval;
> 	I82365* ctlr;
> 	uchar	cdgcr;
>
178c187,196
< 	wrreg(pp, Rpc, Fautopower|Foutena|Fcardena);
---
> 	enaval = Fautopower|Foutena|Fcardena;
> 	ctlr = pp->cp;
> 	if (ctlr->type == Ti82365SLDF){
> 		cdgcr = rdreg(pp, Rcdgcr);
> 		if (pp - slot == 0 && (cdgcr&Fslot1v) == 0)
> 			enaval |= Fcard3v;
> 		if (pp - slot == 1 && (cdgcr&Fslot2v) == 0)
> 			enaval |= Fcard3v;
> 	}
> 	wrreg(pp, Rpc, enaval);
459a478
> [Ti82365SLDF]	"Intel 82365SL-DF",
487a507,509
> 	case 0x84:
> 		cp->type = Ti82365SLDF;
> 		/* has the 3v power bit and is like Ti82365 otherwise */
490d511
< 	case 0x84:
515c536
< 	if(cp->type == Ti82365){
---
> 	if(cp->type == Ti82365 || cp->type == Ti82365SLDF){
901a923,925
> 	uchar cdgcr;
> 	uchar enaval;
> 	I82365* ctlr;
971c995,1006
< 	wrreg(pp, Rpc, x|Fautopower|Foutena|Fcardena);
---
>
> 	enaval = x|Fautopower|Foutena|Fcardena;
> 	ctlr = pp->cp;
> 	if (ctlr->type == Ti82365SLDF){
> 		cdgcr = rdreg(pp, Rcdgcr);
> 		if (slotno == 0 && (cdgcr&Fslot1v) == 0)
> 			enaval |= Fcard3v;
> 		if (slotno == 1 && (cdgcr&Fslot2v) == 0)
> 			enaval |= Fcard3v;
> 	}
>
> 	wrreg(pp, Rpc, enaval);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-05-28 20:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-28 17:04 [9fans] devi82365.c fix Fco.J.Ballesteros
2002-05-28 20:41 presotto
2002-05-28 20:55 presotto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).