[U-Boot] [U-Boot PATCH v2 07/12] i2c, davinci: add support for multiple i2c buses

Tom Rini trini at ti.com
Tue Feb 25 23:11:36 CET 2014


On Thu, Feb 20, 2014 at 12:55:09PM -0500, Murali Karicheri wrote:

> From: Vitaly Andrianov <vitalya at ti.com>
> 
> Signed-off-by: Vitaly Andrianov <vitalya at ti.com>
[snip]
> - * SPDX-License-Identifier:	GPL-2.0+
> + * SPDX-License-Identifier:     GPL-2.0+

Don't change whitespace.

> +static struct i2c_regs __attribute__((section(".data"))) *i2c_base =
> +						(struct i2c_regs *)I2C_BASE;

So you're going to need the i2c driver in SPL?

[snip]
> -	div = (CONFIG_SYS_HZ_CLOCK / ((psc + 1) * speed)) - 10;	/* SCLL + SCLH */
> -	REG(I2C_PSC) = psc;			/* 27MHz / (2 + 1) = 9MHz */
> -	REG(I2C_SCLL) = (div * 50) / 100;	/* 50% Duty */
> -	REG(I2C_SCLH) = div - REG(I2C_SCLL);
> +	div = (CONFIG_SYS_HZ_CLOCK / ((psc + 1) * speed)) - 10;
> +	REG(&(i2c_base->i2c_psc)) = psc;
> +	REG(&(i2c_base->i2c_scll)) = (div * 50) / 100;
> +	REG(&(i2c_base->i2c_sclh)) = div - REG(&(i2c_base->i2c_scll));

Code is equivalent but we lost the comments about what's being done,
please fix.  I think this is the only place but please double check,
thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140225/4b2f5a76/attachment.pgp>


More information about the U-Boot mailing list