From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1890f95b5b25fd97004929ac451ceae0@plan9.escet.urjc.es> To: 9fans@cse.psu.edu From: Fco.J.Ballesteros MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] devi82365.c fix Date: Tue, 28 May 2002 19:04:50 +0200 Topicbox-Message-UUID: 9e913040-eaca-11e9-9e20-41e7f4b1d025 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);