From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Behun Date: Mon, 28 May 2018 14:43:40 +0200 Subject: [U-Boot] [PATCH] arm: mvebu: move i2c slave disable to generic SPL code In-Reply-To: <8ff2bd53-3be7-ae60-decd-9595f89f2f28@denx.de> References: <9accb099dc87fd17cd6c352c7df1c7e55cd2a838.1527434746.git.baruch@tkos.co.il> <10d8eef8-63c7-c86e-5cd7-9e7b138a38c4@denx.de> <20180528095605.lkgldn7v2fwyi2p7@tarshish> <2328ad2a-f316-9b76-8705-f626fea23ad0@denx.de> <20180528100847.qvh4uwtc5r5ki4x6@tarshish> <20180528102938.y7gfjxld2pokzjnw@tarshish> <1b58164b-82e3-20cf-2581-798015ff8be9@denx.de> <20180528104229.wvxkouzh2pn4pb46@tarshish> <8ff2bd53-3be7-ae60-decd-9595f89f2f28@denx.de> Message-ID: <20180528144340.765796fc@nic.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On Mon, 28 May 2018 14:34:07 +0200 Stefan Roese wrote: > On 28.05.2018 12:42, Baruch Siach wrote: >=20 > >=20 > >>>>> __twsi_i2c_init() is called from the main U-Boot image, but not > >>>>> from SPL as far as my testing shows. Clearfog doesn't use i2c > >>>>> from SPL, but the Turris board does. =20 > >>>> > >>>> Can't you switch to DM_I2C then? This should make sure, that the > >>>> probe function is always called before the xfer functions are > >>>> used. =20 > >>> > >>> I plan to do so for Clearfog. But the turris_omnia_defconfig does > >>> not enable DM_I2C. So that would regress Turris. =20 > >> > >> Regress? Definitely not. We plan to remove all non-DM parts at some > >> time. So a move from the ancient driver parts to DM is definitely > >> preferred (especially if the platform and the driver already > >> support DM) - better sooner than later. =20 > >=20 > > What I meant to say is that moving the i2c slave disable code from > > Turris code to the mvtwsi driver would regress Turris unless Turris > > migrates to DM_I2C first. I have no access to the Turris hardware, > > so I can't test the DM_I2C migration on that platform. > >=20 > > If you prefer I can leave the Turris code alone. Instead, I'll add > > the i2c slave disable to mvtwsi. Once Turris migrates to DM_I2C we > > can remove the redundant code from its platform code. > >=20 > > What do you think? =20 >=20 > I would prefer to do this conversion right now and pollute the driver > with stuff that is not needed for DM users. >=20 > Marek Beh=C3=BAn is the maintainer of the Turris Omnia board and should be > able to test such a change quite easily. >=20 > Perhaps its best for now to just add a comment to this code in > board/CZ.NIC/turris_omnia/turris_omnia.c, that this code is not needed > any more, once the board moves over to DM_I2C. And create the same > functionality in the I2C driver for DM_I2C users. This is what you > will be using / testing then and Marek can (read should) move to > DM_I2C soon and remove this code from the board C file then. >=20 > What do you think? >=20 > Thanks, > Stefan Turris Omnia is currently broken in mainline anyway. As far as I am concerned, do what Stefan suggests, add a comment to turris_omnia.c. As soon as I will be more free from Turris Mox work, I am going to work on Turris Omnia... Marek