From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Tue, 25 Feb 2014 17:11:36 -0500 Subject: [U-Boot] [U-Boot PATCH v2 07/12] i2c, davinci: add support for multiple i2c buses In-Reply-To: <1392918914-15564-8-git-send-email-m-karicheri2@ti.com> References: <1392918914-15564-1-git-send-email-m-karicheri2@ti.com> <1392918914-15564-8-git-send-email-m-karicheri2@ti.com> Message-ID: <20140225221136.GJ16805@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Feb 20, 2014 at 12:55:09PM -0500, Murali Karicheri wrote: > From: Vitaly Andrianov > > Signed-off-by: Vitaly Andrianov [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: