From: Stefan Roese Date: Mon, 28 May 2018 14:34:07 +0200 Subject: [U-Boot] [PATCH] arm: mvebu: move i2c slave disable to generic SPL code In-Reply-To: <20180528104229.wvxkouzh2pn4pb46@tarshish> 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> Message-ID: <8ff2bd53-3be7-ae60-decd-9595f89f2f28@denx.de> 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 28.05.2018 12:42, Baruch Siach wrote: >>>>> __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 T= urris >>>>> board does. >>>> >>>> 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. >>> >>> I plan to do so for Clearfog. But the turris_omnia_defconfig does not e= nable >>> DM_I2C. So that would regress Turris. >> >> 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 > 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? I would prefer to do this conversion right now and pollute the driver with stuff that is not needed for DM users. Marek Beh=C3=BAn is the maintainer of the Turris Omnia board and should be able to test such a change quite easily. 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. What do you think? Thanks, Stefan