From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Beno=C3=AEt_Th=C3=A9baudeau?= Date: Thu, 27 Sep 2012 22:24:13 +0200 (CEST) Subject: [U-Boot] [PATCH v2 13/14] mx51: Fix I2C clock ID check In-Reply-To: <1065839952.5372238.1348777198067.JavaMail.root@advansee.com> Message-ID: <1360216704.5372488.1348777453523.JavaMail.root@advansee.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de There are only 2 I?C instances on i.MX51, but 3 on i.MX53. Signed-off-by: Beno?t Th?baudeau Cc: Stefano Babic --- Changes for v2: - New patch. .../arch/arm/cpu/armv7/mx5/clock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git u-boot-imx-e1eb75b.orig/arch/arm/cpu/armv7/mx5/clock.c u-boot-imx-e1eb75b/arch/arm/cpu/armv7/mx5/clock.c index 32dbece..3a60f8b 100644 --- u-boot-imx-e1eb75b.orig/arch/arm/cpu/armv7/mx5/clock.c +++ u-boot-imx-e1eb75b/arch/arm/cpu/armv7/mx5/clock.c @@ -111,12 +111,16 @@ void enable_usboh3_clk(unsigned char enable) } #ifdef CONFIG_I2C_MXC -/* i2c_num can be from 0 - 2 */ +/* i2c_num can be from 0, to 1 for i.MX51 and 2 for i.MX53 */ int enable_i2c_clk(unsigned char enable, unsigned i2c_num) { u32 mask; +#if defined(CONFIG_MX51) + if (i2c_num > 1) +#elif defined(CONFIG_MX53) if (i2c_num > 2) +#endif return -EINVAL; mask = MXC_CCM_CCGR_CG_MASK << (MXC_CCM_CCGR1_I2C1_OFFSET + (i2c_num << 1));