* U-Boot sunxi DM_I2C migration?
@ 2021-08-12 17:49 Tom Rini
2021-08-12 21:22 ` Andre Przywara
0 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2021-08-12 17:49 UTC (permalink / raw)
To: Andre Przywara, u-boot, Jagan Teki
[-- Attachment #1: Type: text/plain, Size: 200 bytes --]
Hey,
As I try and migrate more CONFIG symbols to be Kconfig only, I see that
sunxi is still using the legacy I2C drivers. Is there something
specific holding up migration? Thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: U-Boot sunxi DM_I2C migration?
2021-08-12 17:49 U-Boot sunxi DM_I2C migration? Tom Rini
@ 2021-08-12 21:22 ` Andre Przywara
2021-08-12 21:40 ` Tom Rini
0 siblings, 1 reply; 6+ messages in thread
From: Andre Przywara @ 2021-08-12 21:22 UTC (permalink / raw)
To: Tom Rini; +Cc: u-boot, Jagan Teki, Jernej Škrabec
On Thu, 12 Aug 2021 13:49:30 -0400
Tom Rini <trini@konsulko.com> wrote:
Hi Tom,
> As I try and migrate more CONFIG symbols to be Kconfig only, I see that
> sunxi is still using the legacy I2C drivers. Is there something
> specific holding up migration? Thanks!
Do you mean a DM_I2C conversion, or just moving those base address
symbols to Kconfig? The latter is rather easy, let me know if I should
give it a shot.
For DM_I2C, it's the usual sunxi issue: we are using both: DM_I2C and
DT based probing for U-Boot proper, and hardcoded CONFIG_ symbols for
the SPL. *Some* boards need the set up the PMIC early (for increasing
the CPU frequency or setting the proper DRAM voltage), so this needs to
be done in the SPL. I don't know how to fix this "properly",
but introducing DM (and DT) into the SPL is surely not worth the
trouble. Alternatively we could have a separate, cut-down SPL-only
driver, like we have for SPI (arch/arm/mach-sunxi/spl_spi_sunxi.c),
but not sure that's really better.
If there is something in particular that annoys you about the
situation, we could try to improve this particular issue instead?
Moving the non-DM code into a separate file, maybe?
Cheers,
Andre
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: U-Boot sunxi DM_I2C migration?
2021-08-12 21:22 ` Andre Przywara
@ 2021-08-12 21:40 ` Tom Rini
2021-08-17 19:23 ` Tom Rini
0 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2021-08-12 21:40 UTC (permalink / raw)
To: Andre Przywara; +Cc: u-boot, Jagan Teki, Jernej Škrabec
[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]
On Thu, Aug 12, 2021 at 10:22:07PM +0100, Andre Przywara wrote:
> On Thu, 12 Aug 2021 13:49:30 -0400
> Tom Rini <trini@konsulko.com> wrote:
>
> Hi Tom,
>
> > As I try and migrate more CONFIG symbols to be Kconfig only, I see that
> > sunxi is still using the legacy I2C drivers. Is there something
> > specific holding up migration? Thanks!
>
> Do you mean a DM_I2C conversion, or just moving those base address
> symbols to Kconfig? The latter is rather easy, let me know if I should
> give it a shot.
>
> For DM_I2C, it's the usual sunxi issue: we are using both: DM_I2C and
> DT based probing for U-Boot proper, and hardcoded CONFIG_ symbols for
> the SPL. *Some* boards need the set up the PMIC early (for increasing
> the CPU frequency or setting the proper DRAM voltage), so this needs to
> be done in the SPL. I don't know how to fix this "properly",
> but introducing DM (and DT) into the SPL is surely not worth the
> trouble. Alternatively we could have a separate, cut-down SPL-only
> driver, like we have for SPI (arch/arm/mach-sunxi/spl_spi_sunxi.c),
> but not sure that's really better.
>
> If there is something in particular that annoys you about the
> situation, we could try to improve this particular issue instead?
> Moving the non-DM code into a separate file, maybe?
I'm working on the symbols now (since it gets tricky). The first
example I pulled out was Hummingbird_A31 which does have legacy I2C and
does not set DM_I2C, which is what set me down the more worrying path.
If you can confirm that no, really, it's just SPL that's not using
DM_I2C that's OK enough for now, we can sort out what the best but
probably still unideal solution is long term for SPL.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: U-Boot sunxi DM_I2C migration?
2021-08-12 21:40 ` Tom Rini
@ 2021-08-17 19:23 ` Tom Rini
2021-08-18 5:20 ` Samuel Holland
0 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2021-08-17 19:23 UTC (permalink / raw)
To: Andre Przywara; +Cc: u-boot, Jagan Teki, Jernej Škrabec
[-- Attachment #1: Type: text/plain, Size: 2375 bytes --]
On Thu, Aug 12, 2021 at 05:40:34PM -0400, Tom Rini wrote:
> On Thu, Aug 12, 2021 at 10:22:07PM +0100, Andre Przywara wrote:
> > On Thu, 12 Aug 2021 13:49:30 -0400
> > Tom Rini <trini@konsulko.com> wrote:
> >
> > Hi Tom,
> >
> > > As I try and migrate more CONFIG symbols to be Kconfig only, I see that
> > > sunxi is still using the legacy I2C drivers. Is there something
> > > specific holding up migration? Thanks!
> >
> > Do you mean a DM_I2C conversion, or just moving those base address
> > symbols to Kconfig? The latter is rather easy, let me know if I should
> > give it a shot.
> >
> > For DM_I2C, it's the usual sunxi issue: we are using both: DM_I2C and
> > DT based probing for U-Boot proper, and hardcoded CONFIG_ symbols for
> > the SPL. *Some* boards need the set up the PMIC early (for increasing
> > the CPU frequency or setting the proper DRAM voltage), so this needs to
> > be done in the SPL. I don't know how to fix this "properly",
> > but introducing DM (and DT) into the SPL is surely not worth the
> > trouble. Alternatively we could have a separate, cut-down SPL-only
> > driver, like we have for SPI (arch/arm/mach-sunxi/spl_spi_sunxi.c),
> > but not sure that's really better.
> >
> > If there is something in particular that annoys you about the
> > situation, we could try to improve this particular issue instead?
> > Moving the non-DM code into a separate file, maybe?
>
> I'm working on the symbols now (since it gets tricky). The first
> example I pulled out was Hummingbird_A31 which does have legacy I2C and
> does not set DM_I2C, which is what set me down the more worrying path.
> If you can confirm that no, really, it's just SPL that's not using
> DM_I2C that's OK enough for now, we can sort out what the best but
> probably still unideal solution is long term for SPL.
As I'm converting the symbols to Kconfig now (and adding
SPL_SYS_I2C_LEGACY), what I'm seeing on sunxi is a whole lot of platform
enabling the legacy driver in full U-Boot and not DM_I2C. Now it's
entirely possible the follow up solution really is just to switch to
DM_I2C (and continue SPL_SYS_I2C_LEGACY) and it would be a fairly
trivial switch. But I'm not in a good position to make that change and
test it, so I'm asking you to please, once I've posted this series to
add SPL_SYS_I2C_LEGACY
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: U-Boot sunxi DM_I2C migration?
2021-08-17 19:23 ` Tom Rini
@ 2021-08-18 5:20 ` Samuel Holland
2021-08-18 13:31 ` Tom Rini
0 siblings, 1 reply; 6+ messages in thread
From: Samuel Holland @ 2021-08-18 5:20 UTC (permalink / raw)
To: Tom Rini, Andre Przywara; +Cc: u-boot, Jagan Teki, Jernej Škrabec
Hi all,
On 8/17/21 2:23 PM, Tom Rini wrote:
> On Thu, Aug 12, 2021 at 05:40:34PM -0400, Tom Rini wrote:
>> On Thu, Aug 12, 2021 at 10:22:07PM +0100, Andre Przywara wrote:
>>> On Thu, 12 Aug 2021 13:49:30 -0400
>>> Tom Rini <trini@konsulko.com> wrote:
>>>
>>> Hi Tom,
>>>
>>>> As I try and migrate more CONFIG symbols to be Kconfig only, I see that
>>>> sunxi is still using the legacy I2C drivers. Is there something
>>>> specific holding up migration? Thanks!
>>>
>>> Do you mean a DM_I2C conversion, or just moving those base address
>>> symbols to Kconfig? The latter is rather easy, let me know if I should
>>> give it a shot.
>>>
>>> For DM_I2C, it's the usual sunxi issue: we are using both: DM_I2C and
>>> DT based probing for U-Boot proper, and hardcoded CONFIG_ symbols for
>>> the SPL. *Some* boards need the set up the PMIC early (for increasing
>>> the CPU frequency or setting the proper DRAM voltage), so this needs to
>>> be done in the SPL. I don't know how to fix this "properly",
>>> but introducing DM (and DT) into the SPL is surely not worth the
>>> trouble. Alternatively we could have a separate, cut-down SPL-only
>>> driver, like we have for SPI (arch/arm/mach-sunxi/spl_spi_sunxi.c),
>>> but not sure that's really better.
>>>
>>> If there is something in particular that annoys you about the
>>> situation, we could try to improve this particular issue instead?
>>> Moving the non-DM code into a separate file, maybe?
>>
>> I'm working on the symbols now (since it gets tricky). The first
>> example I pulled out was Hummingbird_A31 which does have legacy I2C and
>> does not set DM_I2C, which is what set me down the more worrying path.
>> If you can confirm that no, really, it's just SPL that's not using
>> DM_I2C that's OK enough for now, we can sort out what the best but
>> probably still unideal solution is long term for SPL.
>
> As I'm converting the symbols to Kconfig now (and adding
> SPL_SYS_I2C_LEGACY), what I'm seeing on sunxi is a whole lot of platform
> enabling the legacy driver in full U-Boot and not DM_I2C. Now it's
> entirely possible the follow up solution really is just to switch to
> DM_I2C (and continue SPL_SYS_I2C_LEGACY) and it would be a fairly
> trivial switch. But I'm not in a good position to make that change and
> test it, so I'm asking you to please, once I've posted this series to
> add SPL_SYS_I2C_LEGACY
I am aware of three places where sunxi boards use legacy I2C in U-Boot proper:
- The i2c_soft usage enabled by CONFIG_VIDEO_LCD_PANEL_I2C
- The axp_gpio driver (through pmic_bus_*)
- do_poweroff() in drivers/power/axp*.c (through pmic_bus_write)
I have a patch series for converting all of these that I will be sending within
the next few days. The two tricky parts are:
- I have no way to test either board that uses VIDEO_LCD_PANEL_I2C,
so I do not want to rely on bus number ordering.
- I am trying to arrange changes in an order that never breaks any
functionality, so some driver must be temporarily compatible with
both legacy and DM I2C.
I will rebase this on top of the Kconfig series before sending it.
Regards,
Samuel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: U-Boot sunxi DM_I2C migration?
2021-08-18 5:20 ` Samuel Holland
@ 2021-08-18 13:31 ` Tom Rini
0 siblings, 0 replies; 6+ messages in thread
From: Tom Rini @ 2021-08-18 13:31 UTC (permalink / raw)
To: Samuel Holland; +Cc: Andre Przywara, u-boot, Jagan Teki, Jernej Škrabec
[-- Attachment #1: Type: text/plain, Size: 3393 bytes --]
On Wed, Aug 18, 2021 at 12:20:10AM -0500, Samuel Holland wrote:
> Hi all,
>
> On 8/17/21 2:23 PM, Tom Rini wrote:
> > On Thu, Aug 12, 2021 at 05:40:34PM -0400, Tom Rini wrote:
> >> On Thu, Aug 12, 2021 at 10:22:07PM +0100, Andre Przywara wrote:
> >>> On Thu, 12 Aug 2021 13:49:30 -0400
> >>> Tom Rini <trini@konsulko.com> wrote:
> >>>
> >>> Hi Tom,
> >>>
> >>>> As I try and migrate more CONFIG symbols to be Kconfig only, I see that
> >>>> sunxi is still using the legacy I2C drivers. Is there something
> >>>> specific holding up migration? Thanks!
> >>>
> >>> Do you mean a DM_I2C conversion, or just moving those base address
> >>> symbols to Kconfig? The latter is rather easy, let me know if I should
> >>> give it a shot.
> >>>
> >>> For DM_I2C, it's the usual sunxi issue: we are using both: DM_I2C and
> >>> DT based probing for U-Boot proper, and hardcoded CONFIG_ symbols for
> >>> the SPL. *Some* boards need the set up the PMIC early (for increasing
> >>> the CPU frequency or setting the proper DRAM voltage), so this needs to
> >>> be done in the SPL. I don't know how to fix this "properly",
> >>> but introducing DM (and DT) into the SPL is surely not worth the
> >>> trouble. Alternatively we could have a separate, cut-down SPL-only
> >>> driver, like we have for SPI (arch/arm/mach-sunxi/spl_spi_sunxi.c),
> >>> but not sure that's really better.
> >>>
> >>> If there is something in particular that annoys you about the
> >>> situation, we could try to improve this particular issue instead?
> >>> Moving the non-DM code into a separate file, maybe?
> >>
> >> I'm working on the symbols now (since it gets tricky). The first
> >> example I pulled out was Hummingbird_A31 which does have legacy I2C and
> >> does not set DM_I2C, which is what set me down the more worrying path.
> >> If you can confirm that no, really, it's just SPL that's not using
> >> DM_I2C that's OK enough for now, we can sort out what the best but
> >> probably still unideal solution is long term for SPL.
> >
> > As I'm converting the symbols to Kconfig now (and adding
> > SPL_SYS_I2C_LEGACY), what I'm seeing on sunxi is a whole lot of platform
> > enabling the legacy driver in full U-Boot and not DM_I2C. Now it's
> > entirely possible the follow up solution really is just to switch to
> > DM_I2C (and continue SPL_SYS_I2C_LEGACY) and it would be a fairly
> > trivial switch. But I'm not in a good position to make that change and
> > test it, so I'm asking you to please, once I've posted this series to
> > add SPL_SYS_I2C_LEGACY
>
> I am aware of three places where sunxi boards use legacy I2C in U-Boot proper:
> - The i2c_soft usage enabled by CONFIG_VIDEO_LCD_PANEL_I2C
> - The axp_gpio driver (through pmic_bus_*)
> - do_poweroff() in drivers/power/axp*.c (through pmic_bus_write)
>
> I have a patch series for converting all of these that I will be sending within
> the next few days. The two tricky parts are:
> - I have no way to test either board that uses VIDEO_LCD_PANEL_I2C,
> so I do not want to rely on bus number ordering.
> - I am trying to arrange changes in an order that never breaks any
> functionality, so some driver must be temporarily compatible with
> both legacy and DM I2C.
>
> I will rebase this on top of the Kconfig series before sending it.
Great, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-08-18 13:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-12 17:49 U-Boot sunxi DM_I2C migration? Tom Rini
2021-08-12 21:22 ` Andre Przywara
2021-08-12 21:40 ` Tom Rini
2021-08-17 19:23 ` Tom Rini
2021-08-18 5:20 ` Samuel Holland
2021-08-18 13:31 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox