Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753630AbbGXJ1w (ORCPT ); Fri, 24 Jul 2015 05:27:52 -0400 Received: from sauhun.de ([89.238.76.85]:36195 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbbGXJ1t (ORCPT ); Fri, 24 Jul 2015 05:27:49 -0400 Date: Fri, 24 Jul 2015 11:27:20 +0200 From: Wolfram Sang To: Andrey Danin Cc: devicetree@vger.kernel.org, devel@linuxdriverproject.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, ac100@lists.launchpad.net, Laxman Dewangan , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Stephen Warren , Thierry Reding , Alexandre Courbot , Greg Kroah-Hartman , Julian Andres Klode , Marc Dietrich Subject: Re: [PATCH v3 1/4] i2c: tegra: implement slave mode Message-ID: <20150724092720.GA1597@katana> References: <1437424546-30405-1-git-send-email-danindrey@mail.ru> <1437424546-30405-2-git-send-email-danindrey@mail.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mYCpIKhGyMATD0i+" Content-Disposition: inline In-Reply-To: <1437424546-30405-2-git-send-email-danindrey@mail.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2468 Lines: 72 --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Andrey, On Mon, Jul 20, 2015 at 11:35:43PM +0300, Andrey Danin wrote: > Initialization code is based on NVEC driver. >=20 > There is a HW bug in AP20 that was also mentioned in kernel sources > for Toshiba AC100. >=20 > Signed-off-by: Andrey Danin Still doesn't work for me and I think I understand why. Do you run your I2C controller in slave mode only? That might work, but using it in master/slave mode simultanously won't work yet as I see it: * After every transfer (as master), clocks get disabled. I assume the IP core won't be able to detect its own address then. * There is this code in tegra_i2c_init(): if (!i2c_dev->is_dvc) { u32 sl_cfg =3D i2c_readl(i2c_dev, I2C_SL_CNFG); sl_cfg |=3D I2C_SL_CNFG_NACK | I2C_SL_CNFG_NEWSL; i2c_writel(i2c_dev, sl_cfg, I2C_SL_CNFG); i2c_writel(i2c_dev, 0xfc, I2C_SL_ADDR1); i2c_writel(i2c_dev, 0x00, I2C_SL_ADDR2); } It probably messes up the slave initialization in tegra_reg_slave(). At least I see that the slave address gets overwritten when I peek the register after boot. Does that make sense to you? Thanks, Wolfram --mYCpIKhGyMATD0i+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVsgT3AAoJEBQN5MwUoCm28TkQAJ8GtWdUEhjDsXnlwbznCTXw 0ztaEoxnmK1CW3iglVwyMEJAC6d8+V3HAItUZbkP+XBRbmBu1OQPOdZNrT9VfaR/ dqjwMWmYg+VxyQGvjCG4uYRFc8YMHYpam3f4y9Gxi8lxz7MDRgDr1o00c08JIZuf FsM2aWXO0qSxhO9PxBCsKIE5gsmw/VTt6tW57oNPrgb4KRWaFmcAmXGUDDwUPy1k R4BwxNMe2wWfAiegGfPDS/vYYveJcNP+Sf3nrNUY4p5hYTVKZsiQdDkIyAYkIiJg uON8pr8DLWvftjXVzQyRrG4g1i+0xvrtSYJsApJw+UXwcSOoNYWNIWwS4xjbKQCO Kvvrz8fbrIkwsn/YFgmOQrLOz/coTeFt3JwNUbhXvvC+dgRqzJPyUW5c0oEd9r7f N7vUKne85chLFOJ7ZNxiGtuJ0Dassn0PP+m4C/e+69MBjyG61OFn5KqLK00SWTJ7 C+8CNYa9nmV0Fh9ed+12VeaqCtXXeg0xOh0oLB0+kRtW2ZH8M5D4JhYnBl/C8ncd PxRBkfKsO/TqrWVbqnyzND7eWVGpsU+TTFL1k1T4hx0n3pHA6tg2o60VaamFctvO s/lyoJ/YPhcrF8lhlMOZtungmAJpF0zpQaC9vI1QPUcLe6raaE65ZSRg9runI0je Epun1jJ9IcWcnOYBR+IE =bK/2 -----END PGP SIGNATURE----- --mYCpIKhGyMATD0i+-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/