* MPC880: i2cer register says tx is done but tx buf descriptor is still ready @ 2007-11-17 10:07 DI BACCO ANTONIO - technolabs 2007-11-17 18:32 ` Jochen Friedrich 0 siblings, 1 reply; 4+ messages in thread From: DI BACCO ANTONIO - technolabs @ 2007-11-17 10:07 UTC (permalink / raw) To: linuxppc-embedded How could it be possible? It happens during the first i2c transactions and then no more.=20 Bye, Antonio. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC880: i2cer register says tx is done but tx buf descriptor is still ready 2007-11-17 10:07 MPC880: i2cer register says tx is done but tx buf descriptor is still ready DI BACCO ANTONIO - technolabs @ 2007-11-17 18:32 ` Jochen Friedrich 2007-11-18 11:12 ` DI BACCO ANTONIO - technolabs 0 siblings, 1 reply; 4+ messages in thread From: Jochen Friedrich @ 2007-11-17 18:32 UTC (permalink / raw) To: DI BACCO ANTONIO - technolabs; +Cc: linuxppc-embedded Hi Antonio, > How could it be possible? It happens during the first i2c transactions > and then no more. > What linux version? Which driver? Thanks, Jochen ^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: MPC880: i2cer register says tx is done but tx buf descriptor is still ready 2007-11-17 18:32 ` Jochen Friedrich @ 2007-11-18 11:12 ` DI BACCO ANTONIO - technolabs 2007-11-19 5:52 ` Ankur Maheshwari 0 siblings, 1 reply; 4+ messages in thread From: DI BACCO ANTONIO - technolabs @ 2007-11-18 11:12 UTC (permalink / raw) To: Jochen Friedrich [-- Attachment #1: Type: text/plain, Size: 1589 bytes --] A porting of the driver included in kernel 2.4. Here is an excerpt of the method to send bytes over the i2c bus: ________________________________________________________________________ i2c->i2c_i2cmr = 0x00; /* Disable I2C interupts */ i2c->i2c_i2cer = 0xff; i2c->i2c_i2mod |= 1; /* Enable */ i2c->i2c_i2com |= 0x80; /* Begin transmission */ tmo = jiffies + 1*HZ; /* Busy wait, with a timeout */ while(!(i2c->i2c_i2cer & 0x12 || time_after(jiffies, tmo))); if (signal_pending(current) || !tmo){ force_close(algo_8xx_data); if (!tmo) printk("IIC write: timeout!\n"); return -EIO; } if ((tbdf[0]->cbd_sc | tbdf[1]->cbd_sc) & BD_SC_NAK) { printk(KERN_INFO "IIC write; no ack\n"); if (cpm_debug > 0) printk("tx0 sc %04x, tx1 sc %04x\n", tbdf[0]->cbd_sc,tbdf[1]->cbd_sc); return 0; } if ((tbdf[0]->cbd_sc | tbdf[1]->cbd_sc) & BD_SC_READY) { printk(KERN_INFO "IIC write; complete but tbuf ready\n"); if (cpm_debug > 0) printk("tx0 sc %04x, tx1 sc %04x\n", tbdf[0]->cbd_sc,tbdf[1]->cbd_sc); return 0; } -----Original Message----- From: Jochen Friedrich [mailto:jochen@scram.de] Sent: Sat 17/11/2007 19.32 To: DI BACCO ANTONIO - technolabs Cc: linuxppc-embedded@ozlabs.org Subject: Re: MPC880: i2cer register says tx is done but tx buf descriptor is still ready Hi Antonio, > How could it be possible? It happens during the first i2c transactions > and then no more. > What linux version? Which driver? Thanks, Jochen [-- Attachment #2: Type: text/html, Size: 2875 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC880: i2cer register says tx is done but tx buf descriptor is still ready 2007-11-18 11:12 ` DI BACCO ANTONIO - technolabs @ 2007-11-19 5:52 ` Ankur Maheshwari 0 siblings, 0 replies; 4+ messages in thread From: Ankur Maheshwari @ 2007-11-19 5:52 UTC (permalink / raw) To: DI BACCO ANTONIO - technolabs; +Cc: linuxppc-embedded Hi Antonio, Check how is your tx_buf is allocated, if its 2.4 kernel , then try allocating using following function tx_buf = (u_char *)m8xx_cpm_hostalloc(512); 512 is the size, also dump and check the difference in start address. I more recommendation, check how your Serial/Network driver has allocated memory, try using same method. thanks, Ankur DI BACCO ANTONIO - technolabs wrote: > > A porting of the driver included in kernel 2.4. > > Here is an excerpt of the method to send bytes over the i2c bus: > ________________________________________________________________________ > i2c->i2c_i2cmr = 0x00; /* Disable I2C interupts */ > i2c->i2c_i2cer = 0xff; > i2c->i2c_i2mod |= 1; /* Enable */ > i2c->i2c_i2com |= 0x80; /* Begin transmission */ > tmo = jiffies + 1*HZ; > /* Busy wait, with a timeout */ > while(!(i2c->i2c_i2cer & 0x12 || time_after(jiffies, tmo))); > > > if (signal_pending(current) || !tmo){ > force_close(algo_8xx_data); > if (!tmo) > printk("IIC write: timeout!\n"); > > return -EIO; > } > > if ((tbdf[0]->cbd_sc | tbdf[1]->cbd_sc) & BD_SC_NAK) { > printk(KERN_INFO "IIC write; no ack\n"); > if (cpm_debug > 0) > printk("tx0 sc %04x, tx1 sc %04x\n", > tbdf[0]->cbd_sc,tbdf[1]->cbd_sc); > > return 0; > } > > if ((tbdf[0]->cbd_sc | tbdf[1]->cbd_sc) & BD_SC_READY) { > printk(KERN_INFO "IIC write; complete but tbuf ready\n"); > if (cpm_debug > 0) > printk("tx0 sc %04x, tx1 sc %04x\n", > tbdf[0]->cbd_sc,tbdf[1]->cbd_sc); > > return 0; > } > > > -----Original Message----- > From: Jochen Friedrich [mailto:jochen@scram.de] > Sent: Sat 17/11/2007 19.32 > To: DI BACCO ANTONIO - technolabs > Cc: linuxppc-embedded@ozlabs.org > Subject: Re: MPC880: i2cer register says tx is done but tx buf > descriptor is still ready > > Hi Antonio, > > > How could it be possible? It happens during the first i2c transactions > > and then no more. > > > > What linux version? Which driver? > > Thanks, > Jochen > > > ------------------------------------------------------------------------ > > _______________________________________________ > Linuxppc-embedded mailing list > Linuxppc-embedded@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-embedded ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-19 5:54 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-11-17 10:07 MPC880: i2cer register says tx is done but tx buf descriptor is still ready DI BACCO ANTONIO - technolabs 2007-11-17 18:32 ` Jochen Friedrich 2007-11-18 11:12 ` DI BACCO ANTONIO - technolabs 2007-11-19 5:52 ` Ankur Maheshwari
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.