All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] fsl_i2c: add workaround for the erratum I2C A004447
Date: Fri, 26 Jul 2013 11:26:43 -0500	[thread overview]
Message-ID: <1374856003.30721.9@snotra> (raw)
In-Reply-To: <1374831543-10131-2-git-send-email-Chunhe.Lan@freescale.com> (from Chunhe.Lan@freescale.com on Fri Jul 26 04:39:03 2013)

On 07/26/2013 04:39:03 AM, Chunhe Lan wrote:
> diff --git a/arch/powerpc/include/asm/processor.h  
> b/arch/powerpc/include/asm/processor.h
> index 56b22d8..156acba 100644
> --- a/arch/powerpc/include/asm/processor.h
> +++ b/arch/powerpc/include/asm/processor.h
> @@ -1073,6 +1073,8 @@
>  #define IS_SVR_REV(svr, maj, min) \
>  	((SVR_MAJ(svr) == maj) && (SVR_MIN(svr) == min))
> 
> +#define FIT_SVR_REV(svr, version)	((svr & 0xff) <= version)

I don't understand how you get "FIT" from "<=".  Why can't the caller  
do <= by itself?

Why does SVR_REV return the low 16 bits rather than the low 8 bits?

Could we try to synchronize what U-Boot does with this Linux patch:
http://patchwork.ozlabs.org/patch/259598/

> diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
> index ef0004d..694247c 100644
> --- a/drivers/i2c/fsl_i2c.c
> +++ b/drivers/i2c/fsl_i2c.c
> @@ -227,6 +227,15 @@ static int i2c_fixup(const struct fsl_i2c *dev)
>  	const unsigned long long timeout =  
> usec2ticks(CONFIG_I2C_MBB_TIMEOUT);
>  	unsigned long long timeval = 0;
>  	int ret = -1;
> +	unsigned int flags = 0;
> +
> +#ifdef CONFIG_SYS_FSL_ERRATUM_I2C_A004447
> +	unsigned int svr = get_svr();
> +	if ((SVR_SOC_VER(svr) == SVR_8548 && IS_SVR_REV(svr, 3, 1)) ||
> +	    (SVR_SOC_VER(svr) == SVR_P1010 && IS_SVR_REV(svr, 1, 0)) ||
> +	     FIT_SVR_REV(svr, CONFIG_SYS_FSL_A004447_VERSION))
> +		flags = I2C_CR_BIT6;
> +#endif

Why can't P1010 use CONFIG_SYS_FSL_A004447_VERSION?

-Scott

      reply	other threads:[~2013-07-26 16:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26  9:39 [U-Boot] [PATCH 1/2] fsl_i2c: generate nine pulses on SCL if the I2C bus is hung Chunhe Lan
2013-07-26  9:39 ` [U-Boot] [PATCH 2/2] fsl_i2c: add workaround for the erratum I2C A004447 Chunhe Lan
2013-07-26 16:26   ` Scott Wood [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=1374856003.30721.9@snotra \
    --to=scottwood@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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.