Subject: Re: microcodepatch

From: Peter Desnoyers <[email-masked]>
Date: Wed, 24 Oct 2001 15:06:31 -0400

The I2C driver doesn't work properly with the microcode patch - it
initializes tbptr and rbptr to 0, not r_tbase and r_rbase, and it uses
the INIT_TRX command (which the patched code doesn't support) instead of
separate INIT_RX and INIT_TX.

You might want to try the attached minor patch, which works for us.

--
.....................................................................
 Peter Desnoyers            (781) 457-1165   [email-masked]
 Chinook Communications     (617) 661-1979   [email-masked]
 100 Hayden Ave, Lexington MA 02421

Index: i2c-algo-8xx.c
===================================================================
RCS file: /src/cvs/hardhat/devkit/lsp/motorola-mbx860/linux-2.4.2_hhl20/drivers/i2c/i2c-algo-8xx.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- i2c-algo-8xx.c	2001/07/24 17:23:38	1.1.1.1
+++ i2c-algo-8xx.c	2001/10/01 19:08:20	1.2
@@ -99,8 +99,12 @@
 		volatile cpm8xx_t *cp = cpm_adap->cp;

 		cp->cp_cpcr =
-			mk_cr_cmd(CPM_CR_CH_I2C, CPM_CR_INIT_TRX) | CPM_CR_FLG;
+			mk_cr_cmd(CPM_CR_CH_I2C, CPM_CR_INIT_RX) | CPM_CR_FLG;
 		while (cp->cp_cpcr & CPM_CR_FLG);
+
+		cp->cp_cpcr =
+			mk_cr_cmd(CPM_CR_CH_I2C, CPM_CR_INIT_TX) | CPM_CR_FLG;
+		while (cp->cp_cpcr & CPM_CR_FLG);
 	}

 	/* Select an arbitrary address.  Just make sure it is unique.
@@ -151,12 +155,12 @@

 	iip->iic_rstate = 0;
 	iip->iic_rdp = 0;
-	iip->iic_rbptr = 0;
+	iip->iic_rbptr = r_rbase;
 	iip->iic_rbc = 0;
 	iip->iic_rxtmp = 0;
 	iip->iic_tstate = 0;
 	iip->iic_tdp = 0;
-	iip->iic_tbptr = 0;
+	iip->iic_tbptr = r_tbase;
 	iip->iic_tbc = 0;
 	iip->iic_txtmp = 0;
 }