[U-Boot] [PATCH] arm: mvebu: move i2c slave disable to generic SPL code
Marek Behun
marek.behun at nic.cz
Mon May 28 12:43:40 UTC 2018
On Mon, 28 May 2018 14:34:07 +0200
Stefan Roese <sr at denx.de> wrote:
> On 28.05.2018 12:42, Baruch Siach wrote:
>
> <snip>
>
> >>>>> __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.
> >>>>
> >>>> 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 enable 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.
> >
> > 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.
> >
> > 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.
> >
> > 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Ășn 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
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
More information about the U-Boot
mailing list