From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Fri, 26 Jul 2013 11:26:43 -0500 Subject: [U-Boot] [PATCH 2/2] fsl_i2c: add workaround for the erratum I2C A004447 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) References: <1374831543-10131-1-git-send-email-Chunhe.Lan@freescale.com> <1374831543-10131-2-git-send-email-Chunhe.Lan@freescale.com> Message-ID: <1374856003.30721.9@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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