All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ankur Maheshwari <ankur_maheshwari@procsys.com>
To: DI BACCO ANTONIO - technolabs <Antonio.DiBacco@technolabs.it>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: MPC880: i2cer register says tx is done but tx buf descriptor is	still	ready
Date: Mon, 19 Nov 2007 11:22:59 +0530	[thread overview]
Message-ID: <474124BB.7010308@procsys.com> (raw)
In-Reply-To: <F1F6EC0C8B75034F9E3A79FC85122E8E2649F4@aquib01a>

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

      reply	other threads:[~2007-11-19  5:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=474124BB.7010308@procsys.com \
    --to=ankur_maheshwari@procsys.com \
    --cc=Antonio.DiBacco@technolabs.it \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.