[U-Boot] [PATCH 28/28] armv8/fsl-lsch3: Implement workaround for I2C issue
This erratum requires setting GLITCH_EN bit in debug register. Signed-off-by: York Sun --- arch/arm/cpu/armv8/fsl-lsch3/soc.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/arch/arm/cpu/armv8/fsl-lsch3/soc.c b/arch/arm/cpu/armv8/fsl-lsch3/soc.c index ca00108..4d9df20 100644 --- a/arch/arm/cpu/armv8/fsl-lsch3/soc.c +++ b/arch/arm/cpu/armv8/fsl-lsch3/soc.c @@ -37,11 +37,41 @@ static void erratum_rcw_src(void) #endif } +#define I2C_DEBUG_REG 0x6 +#define I2C_GLITCH_EN 0x8 +static void erratum_i2c(void) +{ + u8 __iomem *ptr; +#ifdef CONFIG_SYS_I2C +#ifdef I2C1_BASE_ADDR + ptr = (u8 __iomem *)(I2C1_BASE_ADDR + I2C_DEBUG_REG); + + writeb(I2C_GLITCH_EN, ptr); +#endif +#ifdef I2C2_BASE_ADDR + ptr = (u8 __iomem *)(I2C2_BASE_ADDR + I2C_DEBUG_REG); + + writeb(I2C_GLITCH_EN, ptr); +#endif +#ifdef I2C3_BASE_ADDR + ptr = (u8 __iomem *)(I2C3_BASE_ADDR + I2C_DEBUG_REG); + + writeb(I2C_GLITCH_EN, ptr); +#endif +#ifdef I2C4_BASE_ADDR + ptr = (u8 __iomem *)(I2C4_BASE_ADDR + I2C_DEBUG_REG); + + writeb(I2C_GLITCH_EN, ptr); +#endif +#endif +} + void fsl_lsch3_early_init_f(void) { erratum_a008751(); erratum_rcw_src(); init_early_memctl_regs(); /* tighten IFC timing */ + erratum_i2c(); } #ifdef CONFIG_SPL_BUILD -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 28/28] armv8/fsl-lsch3: Implement workaround for I2C issue
Hello York, Am 19.03.2015 17:45, schrieb York Sun: This erratum requires setting GLITCH_EN bit in debug register. Signed-off-by: York Sun --- arch/arm/cpu/armv8/fsl-lsch3/soc.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/arch/arm/cpu/armv8/fsl-lsch3/soc.c b/arch/arm/cpu/armv8/fsl-lsch3/soc.c index ca00108..4d9df20 100644 --- a/arch/arm/cpu/armv8/fsl-lsch3/soc.c +++ b/arch/arm/cpu/armv8/fsl-lsch3/soc.c @@ -37,11 +37,41 @@ static void erratum_rcw_src(void) #endif } +#define I2C_DEBUG_REG 0x6 +#define I2C_GLITCH_EN 0x8 +static void erratum_i2c(void) Could you add here a short comment, where to find some info about this erratum? Thanks! +{ + u8 __iomem *ptr; +#ifdef CONFIG_SYS_I2C +#ifdef I2C1_BASE_ADDR + ptr = (u8 __iomem *)(I2C1_BASE_ADDR + I2C_DEBUG_REG); using a struct here would be nicer ... bye, Heiko + + writeb(I2C_GLITCH_EN, ptr); +#endif +#ifdef I2C2_BASE_ADDR + ptr = (u8 __iomem *)(I2C2_BASE_ADDR + I2C_DEBUG_REG); + + writeb(I2C_GLITCH_EN, ptr); +#endif +#ifdef I2C3_BASE_ADDR + ptr = (u8 __iomem *)(I2C3_BASE_ADDR + I2C_DEBUG_REG); + + writeb(I2C_GLITCH_EN, ptr); +#endif +#ifdef I2C4_BASE_ADDR + ptr = (u8 __iomem *)(I2C4_BASE_ADDR + I2C_DEBUG_REG); + + writeb(I2C_GLITCH_EN, ptr); +#endif +#endif +} + void fsl_lsch3_early_init_f(void) { erratum_a008751(); erratum_rcw_src(); init_early_memctl_regs(); /* tighten IFC timing */ + erratum_i2c(); } #ifdef CONFIG_SPL_BUILD -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 28/28] armv8/fsl-lsch3: Implement workaround for I2C issue
On 03/19/2015 10:35 PM, Heiko Schocher wrote: > Hello York, > > Am 19.03.2015 17:45, schrieb York Sun: >> This erratum requires setting GLITCH_EN bit in debug register. >> >> Signed-off-by: York Sun >> --- >> arch/arm/cpu/armv8/fsl-lsch3/soc.c | 30 ++ >> 1 file changed, 30 insertions(+) >> >> diff --git a/arch/arm/cpu/armv8/fsl-lsch3/soc.c >> b/arch/arm/cpu/armv8/fsl-lsch3/soc.c >> index ca00108..4d9df20 100644 >> --- a/arch/arm/cpu/armv8/fsl-lsch3/soc.c >> +++ b/arch/arm/cpu/armv8/fsl-lsch3/soc.c >> @@ -37,11 +37,41 @@ static void erratum_rcw_src(void) >> #endif >> } >> >> +#define I2C_DEBUG_REG 0x6 >> +#define I2C_GLITCH_EN 0x8 >> +static void erratum_i2c(void) > > Could you add here a short comment, where to find some info > about this erratum? Thanks! Sure I can add some comment. I am still waiting for design team to finalize the document so users can access. The purpose of posting this patch now is to help users to overcome this issue as boards are being shipped out. > >> +{ >> +u8 __iomem *ptr; >> +#ifdef CONFIG_SYS_I2C >> +#ifdef I2C1_BASE_ADDR >> +ptr = (u8 __iomem *)(I2C1_BASE_ADDR + I2C_DEBUG_REG); > > using a struct here would be nicer ... > I agree it would look better. But my concern is this debug register is new and only exists on this SoC. Since I am reusing the driver, I am reluctant to add this register for the purpose of the workaround. York ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot