mbox series

[U-Boot,v4,0/9] mmc: sunxi: Enable DM_MMC

Message ID 20190129155416.116919-1-andre.przywara@arm.com
Headers show
Series mmc: sunxi: Enable DM_MMC | expand

Message

Andre Przywara Jan. 29, 2019, 3:54 p.m. UTC
This series gathers all remaining patches we need to enable DM_MMC for
Allwinner boards. It relies on the clock gates framework already merged,
and adds the respective gates and resets for each SoC.
It then teaches the sunxi MMC driver to use the clock framework for
those reset and gates clocks. The "mod clock", responsible for setting
the actual interface speed, is still handled in the MMC driver, as the
DM_CLK part of that is not ready yet (and is not trivial).
This allows to turn on DM_MMC, and gets rid of the doomsday warning
message every Allwinner board was blessed with for a while.

This series is available at:
https://github.com/apritzel/u-boot/commits/sunxi-dm-gates

---------------------------

Jagan, can you please have a look whether this is fine? If you are not
sure about patch 7, you can leave this one out for now.
If you are good with it, can you merge it to sunxi/master and send the
PR, so that it still goes into the release?
We can then fix all the remaining issues until the release.

Cheers,
Andre.

Changes in v4:
- Add proper A80 support (special MMC config clock)
- Add V3s support (gates and resets)
- Fix pinmux problem when not booting via SD or eMMC
- smaller fixes per ML discussion
Changes for v3:
- Handle clock via CLK framework.
Changes for v2:
- update the 'reset enablement' logic to do
  required SoC's

Andre Przywara (5):
  sunxi: clk: enable clk and reset for CCU devices
  sunxi: clk: add MMC gates/resets
  sunxi: clk: A80: add MMC clock support
  mmc: sunxi: Add DM clk and reset support
  sunxi: board: do MMC pinmux setup for DM_MMC builds

Jagan Teki (4):
  mmc: sunxi: Add remaining compatible strings
  mmc: sunxi: Add DM_MMC support for H6
  arm: sunxi: Enable DM_MMC
  arm: dts: sunxi: Enumerate MMC2 as MMC1

 arch/arm/Kconfig                      |  1 +
 arch/arm/dts/sunxi-u-boot.dtsi        |  4 +++
 arch/arm/mach-sunxi/Kconfig           |  1 -
 board/sunxi/board.c                   | 15 ++++++++++
 configs/Linksprite_pcDuino3_defconfig |  1 -
 drivers/clk/sunxi/clk_a10.c           |  4 +++
 drivers/clk/sunxi/clk_a10s.c          |  3 ++
 drivers/clk/sunxi/clk_a23.c           |  6 ++++
 drivers/clk/sunxi/clk_a31.c           |  8 +++++
 drivers/clk/sunxi/clk_a64.c           |  6 ++++
 drivers/clk/sunxi/clk_a80.c           | 32 +++++++++++++++++++-
 drivers/clk/sunxi/clk_a83t.c          |  6 ++++
 drivers/clk/sunxi/clk_h3.c            |  6 ++++
 drivers/clk/sunxi/clk_h6.c            |  6 ++++
 drivers/clk/sunxi/clk_r40.c           |  8 +++++
 drivers/clk/sunxi/clk_sunxi.c         | 12 ++++++++
 drivers/clk/sunxi/clk_v3s.c           |  6 ++++
 drivers/mmc/sunxi_mmc.c               | 42 +++++++++++++++++++++++----
 18 files changed, 159 insertions(+), 8 deletions(-)

Comments

Jagan Teki Jan. 29, 2019, 5:42 p.m. UTC | #1
On Tue, Jan 29, 2019 at 9:24 PM Andre Przywara <andre.przywara@arm.com> wrote:
>
> This series gathers all remaining patches we need to enable DM_MMC for
> Allwinner boards. It relies on the clock gates framework already merged,
> and adds the respective gates and resets for each SoC.
> It then teaches the sunxi MMC driver to use the clock framework for
> those reset and gates clocks. The "mod clock", responsible for setting
> the actual interface speed, is still handled in the MMC driver, as the
> DM_CLK part of that is not ready yet (and is not trivial).
> This allows to turn on DM_MMC, and gets rid of the doomsday warning
> message every Allwinner board was blessed with for a while.
>
> This series is available at:
> https://github.com/apritzel/u-boot/commits/sunxi-dm-gates
>
> ---------------------------
>
> Jagan, can you please have a look whether this is fine? If you are not
> sure about patch 7, you can leave this one out for now.
> If you are good with it, can you merge it to sunxi/master and send the
> PR, so that it still goes into the release?
> We can then fix all the remaining issues until the release.
>
> Cheers,
> Andre.
>
> Changes in v4:
> - Add proper A80 support (special MMC config clock)
> - Add V3s support (gates and resets)
> - Fix pinmux problem when not booting via SD or eMMC
> - smaller fixes per ML discussion
> Changes for v3:
> - Handle clock via CLK framework.
> Changes for v2:
> - update the 'reset enablement' logic to do
>   required SoC's
>
> Andre Przywara (5):
>   sunxi: clk: enable clk and reset for CCU devices
>   sunxi: clk: add MMC gates/resets
>   sunxi: clk: A80: add MMC clock support
>   mmc: sunxi: Add DM clk and reset support
>   sunxi: board: do MMC pinmux setup for DM_MMC builds

Does this fix any issue? not sure why is this part of DM_MMC? in fact
I didn't see any issues.

>
> Jagan Teki (4):
>   mmc: sunxi: Add remaining compatible strings
>   mmc: sunxi: Add DM_MMC support for H6
>   arm: sunxi: Enable DM_MMC
>   arm: dts: sunxi: Enumerate MMC2 as MMC1

I have next version change for this? will replace.

patch [1] should be also be part of the DM_MMC w/o this SD is unable
to detect in sopine boards.

[1] https://patchwork.ozlabs.org/patch/1027858/

Pritt, can you test the FEL that you mentioned on IRC?
Andre Przywara Jan. 29, 2019, 5:49 p.m. UTC | #2
On Tue, 29 Jan 2019 23:12:17 +0530
Jagan Teki <jagan@amarulasolutions.com> wrote:

Hi,

> On Tue, Jan 29, 2019 at 9:24 PM Andre Przywara
> <andre.przywara@arm.com> wrote:
> >
> > This series gathers all remaining patches we need to enable DM_MMC
> > for Allwinner boards. It relies on the clock gates framework
> > already merged, and adds the respective gates and resets for each
> > SoC. It then teaches the sunxi MMC driver to use the clock
> > framework for those reset and gates clocks. The "mod clock",
> > responsible for setting the actual interface speed, is still
> > handled in the MMC driver, as the DM_CLK part of that is not ready
> > yet (and is not trivial). This allows to turn on DM_MMC, and gets
> > rid of the doomsday warning message every Allwinner board was
> > blessed with for a while.
> >
> > This series is available at:
> > https://github.com/apritzel/u-boot/commits/sunxi-dm-gates
> >
> > ---------------------------
> >
> > Jagan, can you please have a look whether this is fine? If you are
> > not sure about patch 7, you can leave this one out for now.
> > If you are good with it, can you merge it to sunxi/master and send
> > the PR, so that it still goes into the release?
> > We can then fix all the remaining issues until the release.
> >
> > Cheers,
> > Andre.
> >
> > Changes in v4:
> > - Add proper A80 support (special MMC config clock)
> > - Add V3s support (gates and resets)
> > - Fix pinmux problem when not booting via SD or eMMC
> > - smaller fixes per ML discussion
> > Changes for v3:
> > - Handle clock via CLK framework.
> > Changes for v2:
> > - update the 'reset enablement' logic to do
> >   required SoC's
> >
> > Andre Przywara (5):
> >   sunxi: clk: enable clk and reset for CCU devices
> >   sunxi: clk: add MMC gates/resets
> >   sunxi: clk: A80: add MMC clock support
> >   mmc: sunxi: Add DM clk and reset support
> >   sunxi: board: do MMC pinmux setup for DM_MMC builds  
> 
> Does this fix any issue? not sure why is this part of DM_MMC? in fact
> I didn't see any issues.

This fixes boot via FEL or SPI flash, where the SPL won't setup the
pinmux for us. I should have mentioned that explicitly in the commit
message, sorry.

> >
> > Jagan Teki (4):
> >   mmc: sunxi: Add remaining compatible strings
> >   mmc: sunxi: Add DM_MMC support for H6
> >   arm: sunxi: Enable DM_MMC
> >   arm: dts: sunxi: Enumerate MMC2 as MMC1  
> 
> I have next version change for this? will replace.
> 
> patch [1] should be also be part of the DM_MMC w/o this SD is unable
> to detect in sopine boards.

I know, if you are OK with it, can you please add it to the series, at
best with your Reviewed-by? Otherwise we can still take it later as a
fix.

Thanks,
Andre

> [1] https://patchwork.ozlabs.org/patch/1027858/
> 
> Pritt, can you test the FEL that you mentioned on IRC?
Jagan Teki Jan. 29, 2019, 5:53 p.m. UTC | #3
On Tue, Jan 29, 2019 at 11:20 PM Andre Przywara <andre.przywara@arm.com> wrote:
>
> On Tue, 29 Jan 2019 23:12:17 +0530
> Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Hi,
>
> > On Tue, Jan 29, 2019 at 9:24 PM Andre Przywara
> > <andre.przywara@arm.com> wrote:
> > >
> > > This series gathers all remaining patches we need to enable DM_MMC
> > > for Allwinner boards. It relies on the clock gates framework
> > > already merged, and adds the respective gates and resets for each
> > > SoC. It then teaches the sunxi MMC driver to use the clock
> > > framework for those reset and gates clocks. The "mod clock",
> > > responsible for setting the actual interface speed, is still
> > > handled in the MMC driver, as the DM_CLK part of that is not ready
> > > yet (and is not trivial). This allows to turn on DM_MMC, and gets
> > > rid of the doomsday warning message every Allwinner board was
> > > blessed with for a while.
> > >
> > > This series is available at:
> > > https://github.com/apritzel/u-boot/commits/sunxi-dm-gates
> > >
> > > ---------------------------
> > >
> > > Jagan, can you please have a look whether this is fine? If you are
> > > not sure about patch 7, you can leave this one out for now.
> > > If you are good with it, can you merge it to sunxi/master and send
> > > the PR, so that it still goes into the release?
> > > We can then fix all the remaining issues until the release.
> > >
> > > Cheers,
> > > Andre.
> > >
> > > Changes in v4:
> > > - Add proper A80 support (special MMC config clock)
> > > - Add V3s support (gates and resets)
> > > - Fix pinmux problem when not booting via SD or eMMC
> > > - smaller fixes per ML discussion
> > > Changes for v3:
> > > - Handle clock via CLK framework.
> > > Changes for v2:
> > > - update the 'reset enablement' logic to do
> > >   required SoC's
> > >
> > > Andre Przywara (5):
> > >   sunxi: clk: enable clk and reset for CCU devices
> > >   sunxi: clk: add MMC gates/resets
> > >   sunxi: clk: A80: add MMC clock support
> > >   mmc: sunxi: Add DM clk and reset support
> > >   sunxi: board: do MMC pinmux setup for DM_MMC builds
> >
> > Does this fix any issue? not sure why is this part of DM_MMC? in fact
> > I didn't see any issues.
>
> This fixes boot via FEL or SPI flash, where the SPL won't setup the
> pinmux for us. I should have mentioned that explicitly in the commit
> message, sorry.

np, may be i will add while applying. and is this FEL issue that Pritt
pointed out?

>
> > >
> > > Jagan Teki (4):
> > >   mmc: sunxi: Add remaining compatible strings
> > >   mmc: sunxi: Add DM_MMC support for H6
> > >   arm: sunxi: Enable DM_MMC
> > >   arm: dts: sunxi: Enumerate MMC2 as MMC1
> >
> > I have next version change for this? will replace.
> >
> > patch [1] should be also be part of the DM_MMC w/o this SD is unable
> > to detect in sopine boards.
>
> I know, if you are OK with it, can you please add it to the series, at
> best with your Reviewed-by? Otherwise we can still take it later as a
> fix.

Will take this, anyway.
Tomas Novotny Jan. 30, 2019, 10:16 a.m. UTC | #4
Hi Andre,

On Tue, 29 Jan 2019 15:54:07 +0000, Andre Przywara <andre.przywara@arm.com>
wrote:
> This series gathers all remaining patches we need to enable DM_MMC for
> Allwinner boards. It relies on the clock gates framework already merged,
> and adds the respective gates and resets for each SoC.
> It then teaches the sunxi MMC driver to use the clock framework for
> those reset and gates clocks. The "mod clock", responsible for setting
> the actual interface speed, is still handled in the MMC driver, as the
> DM_CLK part of that is not ready yet (and is not trivial).
> This allows to turn on DM_MMC, and gets rid of the doomsday warning
> message every Allwinner board was blessed with for a while.
> 
> This series is available at:
> https://github.com/apritzel/u-boot/commits/sunxi-dm-gates

I've briefly tested that branch on A83t mainlined tablet (TBS A711). I was
able to boot from SD card and eMMC.

Just noticed that message:
MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
I guess that this is the mmc1/2 renaming stuff?

With 2019.01 I got:
MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1

Tomas

> ---------------------------
> 
> Jagan, can you please have a look whether this is fine? If you are not
> sure about patch 7, you can leave this one out for now.
> If you are good with it, can you merge it to sunxi/master and send the
> PR, so that it still goes into the release?
> We can then fix all the remaining issues until the release.
> 
> Cheers,
> Andre.
> 
> Changes in v4:
> - Add proper A80 support (special MMC config clock)
> - Add V3s support (gates and resets)
> - Fix pinmux problem when not booting via SD or eMMC
> - smaller fixes per ML discussion
> Changes for v3:
> - Handle clock via CLK framework.
> Changes for v2:
> - update the 'reset enablement' logic to do
>   required SoC's
> 
> Andre Przywara (5):
>   sunxi: clk: enable clk and reset for CCU devices
>   sunxi: clk: add MMC gates/resets
>   sunxi: clk: A80: add MMC clock support
>   mmc: sunxi: Add DM clk and reset support
>   sunxi: board: do MMC pinmux setup for DM_MMC builds
> 
> Jagan Teki (4):
>   mmc: sunxi: Add remaining compatible strings
>   mmc: sunxi: Add DM_MMC support for H6
>   arm: sunxi: Enable DM_MMC
>   arm: dts: sunxi: Enumerate MMC2 as MMC1
> 
>  arch/arm/Kconfig                      |  1 +
>  arch/arm/dts/sunxi-u-boot.dtsi        |  4 +++
>  arch/arm/mach-sunxi/Kconfig           |  1 -
>  board/sunxi/board.c                   | 15 ++++++++++
>  configs/Linksprite_pcDuino3_defconfig |  1 -
>  drivers/clk/sunxi/clk_a10.c           |  4 +++
>  drivers/clk/sunxi/clk_a10s.c          |  3 ++
>  drivers/clk/sunxi/clk_a23.c           |  6 ++++
>  drivers/clk/sunxi/clk_a31.c           |  8 +++++
>  drivers/clk/sunxi/clk_a64.c           |  6 ++++
>  drivers/clk/sunxi/clk_a80.c           | 32 +++++++++++++++++++-
>  drivers/clk/sunxi/clk_a83t.c          |  6 ++++
>  drivers/clk/sunxi/clk_h3.c            |  6 ++++
>  drivers/clk/sunxi/clk_h6.c            |  6 ++++
>  drivers/clk/sunxi/clk_r40.c           |  8 +++++
>  drivers/clk/sunxi/clk_sunxi.c         | 12 ++++++++
>  drivers/clk/sunxi/clk_v3s.c           |  6 ++++
>  drivers/mmc/sunxi_mmc.c               | 42 +++++++++++++++++++++++----
>  18 files changed, 159 insertions(+), 8 deletions(-)
>
Andre Przywara Jan. 30, 2019, 11:46 a.m. UTC | #5
On Wed, 30 Jan 2019 11:16:07 +0100
Tomas Novotny <tomas@novotny.cz> wrote:

Hi,

> On Tue, 29 Jan 2019 15:54:07 +0000, Andre Przywara
> <andre.przywara@arm.com> wrote:
> > This series gathers all remaining patches we need to enable DM_MMC
> > for Allwinner boards. It relies on the clock gates framework
> > already merged, and adds the respective gates and resets for each
> > SoC. It then teaches the sunxi MMC driver to use the clock
> > framework for those reset and gates clocks. The "mod clock",
> > responsible for setting the actual interface speed, is still
> > handled in the MMC driver, as the DM_CLK part of that is not ready
> > yet (and is not trivial). This allows to turn on DM_MMC, and gets
> > rid of the doomsday warning message every Allwinner board was
> > blessed with for a while.
> > 
> > This series is available at:
> > https://github.com/apritzel/u-boot/commits/sunxi-dm-gates  
> 
> I've briefly tested that branch on A83t mainlined tablet (TBS A711).
> I was able to boot from SD card and eMMC.
> 
> Just noticed that message:
> MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
> mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
> I guess that this is the mmc1/2 renaming stuff?

I think so. So is this just a warning, and it continues anyway and
works?

TBH, I don't like this patch 9/9 very much, I actually believe relying
on this numbering scheme in /aliases is something odd and fragile.
Especially since Linux (and other OSes) seem to get away without it.

For MMC, can't we just enumerate them dynamically? AFAIU the MMC driver
would not probe a block device successfully on an SDIO device, would it?

But for the sake of having something working, I am fine with the patch,
at least on a for-now basis.

Cheers,
Andre.
 
> With 2019.01 I got:
> MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
> 
> Tomas
> 
> > ---------------------------
> > 
> > Jagan, can you please have a look whether this is fine? If you are
> > not sure about patch 7, you can leave this one out for now.
> > If you are good with it, can you merge it to sunxi/master and send
> > the PR, so that it still goes into the release?
> > We can then fix all the remaining issues until the release.
> > 
> > Cheers,
> > Andre.
> > 
> > Changes in v4:
> > - Add proper A80 support (special MMC config clock)
> > - Add V3s support (gates and resets)
> > - Fix pinmux problem when not booting via SD or eMMC
> > - smaller fixes per ML discussion
> > Changes for v3:
> > - Handle clock via CLK framework.
> > Changes for v2:
> > - update the 'reset enablement' logic to do
> >   required SoC's
> > 
> > Andre Przywara (5):
> >   sunxi: clk: enable clk and reset for CCU devices
> >   sunxi: clk: add MMC gates/resets
> >   sunxi: clk: A80: add MMC clock support
> >   mmc: sunxi: Add DM clk and reset support
> >   sunxi: board: do MMC pinmux setup for DM_MMC builds
> > 
> > Jagan Teki (4):
> >   mmc: sunxi: Add remaining compatible strings
> >   mmc: sunxi: Add DM_MMC support for H6
> >   arm: sunxi: Enable DM_MMC
> >   arm: dts: sunxi: Enumerate MMC2 as MMC1
> > 
> >  arch/arm/Kconfig                      |  1 +
> >  arch/arm/dts/sunxi-u-boot.dtsi        |  4 +++
> >  arch/arm/mach-sunxi/Kconfig           |  1 -
> >  board/sunxi/board.c                   | 15 ++++++++++
> >  configs/Linksprite_pcDuino3_defconfig |  1 -
> >  drivers/clk/sunxi/clk_a10.c           |  4 +++
> >  drivers/clk/sunxi/clk_a10s.c          |  3 ++
> >  drivers/clk/sunxi/clk_a23.c           |  6 ++++
> >  drivers/clk/sunxi/clk_a31.c           |  8 +++++
> >  drivers/clk/sunxi/clk_a64.c           |  6 ++++
> >  drivers/clk/sunxi/clk_a80.c           | 32 +++++++++++++++++++-
> >  drivers/clk/sunxi/clk_a83t.c          |  6 ++++
> >  drivers/clk/sunxi/clk_h3.c            |  6 ++++
> >  drivers/clk/sunxi/clk_h6.c            |  6 ++++
> >  drivers/clk/sunxi/clk_r40.c           |  8 +++++
> >  drivers/clk/sunxi/clk_sunxi.c         | 12 ++++++++
> >  drivers/clk/sunxi/clk_v3s.c           |  6 ++++
> >  drivers/mmc/sunxi_mmc.c               | 42
> > +++++++++++++++++++++++---- 18 files changed, 159 insertions(+), 8
> > deletions(-) 
> 
>
Jagan Teki Jan. 30, 2019, 12:50 p.m. UTC | #6
On Wed, Jan 30, 2019 at 5:17 PM Andre Przywara <andre.przywara@arm.com> wrote:
>
> On Wed, 30 Jan 2019 11:16:07 +0100
> Tomas Novotny <tomas@novotny.cz> wrote:
>
> Hi,
>
> > On Tue, 29 Jan 2019 15:54:07 +0000, Andre Przywara
> > <andre.przywara@arm.com> wrote:
> > > This series gathers all remaining patches we need to enable DM_MMC
> > > for Allwinner boards. It relies on the clock gates framework
> > > already merged, and adds the respective gates and resets for each
> > > SoC. It then teaches the sunxi MMC driver to use the clock
> > > framework for those reset and gates clocks. The "mod clock",
> > > responsible for setting the actual interface speed, is still
> > > handled in the MMC driver, as the DM_CLK part of that is not ready
> > > yet (and is not trivial). This allows to turn on DM_MMC, and gets
> > > rid of the doomsday warning message every Allwinner board was
> > > blessed with for a while.
> > >
> > > This series is available at:
> > > https://github.com/apritzel/u-boot/commits/sunxi-dm-gates
> >
> > I've briefly tested that branch on A83t mainlined tablet (TBS A711).
> > I was able to boot from SD card and eMMC.
> >
> > Just noticed that message:
> > MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
> > mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
> > I guess that this is the mmc1/2 renaming stuff?
>
> I think so. So is this just a warning, and it continues anyway and
> works?
>
> TBH, I don't like this patch 9/9 very much, I actually believe relying
> on this numbering scheme in /aliases is something odd and fragile.
> Especially since Linux (and other OSes) seem to get away without it.
>
> For MMC, can't we just enumerate them dynamically? AFAIU the MMC driver
> would not probe a block device successfully on an SDIO device, would it?
>
> But for the sake of having something working, I am fine with the patch,
> at least on a for-now basis.

It's not a simple think that 9/9 fix is for,It's something big like
w/o that we can't get the default env and fastboot devices because we
always assign mmc1 for these purposes and indeed mmc1 is SDIO for DT
enumeration.
Tomas Novotny Jan. 30, 2019, 1:35 p.m. UTC | #7
Hi,

On Wed, 30 Jan 2019 11:46:55 +0000, Andre Przywara <andre.przywara@arm.com>
wrote:
> On Wed, 30 Jan 2019 11:16:07 +0100
> Tomas Novotny <tomas@novotny.cz> wrote:
> 
> Hi,
> 
> > On Tue, 29 Jan 2019 15:54:07 +0000, Andre Przywara
> > <andre.przywara@arm.com> wrote:  
> > > This series gathers all remaining patches we need to enable DM_MMC
> > > for Allwinner boards. It relies on the clock gates framework
> > > already merged, and adds the respective gates and resets for each
> > > SoC. It then teaches the sunxi MMC driver to use the clock
> > > framework for those reset and gates clocks. The "mod clock",
> > > responsible for setting the actual interface speed, is still
> > > handled in the MMC driver, as the DM_CLK part of that is not ready
> > > yet (and is not trivial). This allows to turn on DM_MMC, and gets
> > > rid of the doomsday warning message every Allwinner board was
> > > blessed with for a while.
> > > 
> > > This series is available at:
> > > https://github.com/apritzel/u-boot/commits/sunxi-dm-gates    
> > 
> > I've briefly tested that branch on A83t mainlined tablet (TBS A711).
> > I was able to boot from SD card and eMMC.
> > 
> > Just noticed that message:
> > MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
> > mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
> > I guess that this is the mmc1/2 renaming stuff?  
> 
> I think so. So is this just a warning, and it continues anyway and
> works?

yes. Just a warning and it successfully boots then.

Tomas

> TBH, I don't like this patch 9/9 very much, I actually believe relying
> on this numbering scheme in /aliases is something odd and fragile.
> Especially since Linux (and other OSes) seem to get away without it.
> 
> For MMC, can't we just enumerate them dynamically? AFAIU the MMC driver
> would not probe a block device successfully on an SDIO device, would it?
> 
> But for the sake of having something working, I am fine with the patch,
> at least on a for-now basis.
> 
> Cheers,
> Andre.
>  
> > With 2019.01 I got:
> > MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
> > 
> > Tomas
> >   
> > > ---------------------------
> > > 
> > > Jagan, can you please have a look whether this is fine? If you are
> > > not sure about patch 7, you can leave this one out for now.
> > > If you are good with it, can you merge it to sunxi/master and send
> > > the PR, so that it still goes into the release?
> > > We can then fix all the remaining issues until the release.
> > > 
> > > Cheers,
> > > Andre.
> > > 
> > > Changes in v4:
> > > - Add proper A80 support (special MMC config clock)
> > > - Add V3s support (gates and resets)
> > > - Fix pinmux problem when not booting via SD or eMMC
> > > - smaller fixes per ML discussion
> > > Changes for v3:
> > > - Handle clock via CLK framework.
> > > Changes for v2:
> > > - update the 'reset enablement' logic to do
> > >   required SoC's
> > > 
> > > Andre Przywara (5):
> > >   sunxi: clk: enable clk and reset for CCU devices
> > >   sunxi: clk: add MMC gates/resets
> > >   sunxi: clk: A80: add MMC clock support
> > >   mmc: sunxi: Add DM clk and reset support
> > >   sunxi: board: do MMC pinmux setup for DM_MMC builds
> > > 
> > > Jagan Teki (4):
> > >   mmc: sunxi: Add remaining compatible strings
> > >   mmc: sunxi: Add DM_MMC support for H6
> > >   arm: sunxi: Enable DM_MMC
> > >   arm: dts: sunxi: Enumerate MMC2 as MMC1
> > > 
> > >  arch/arm/Kconfig                      |  1 +
> > >  arch/arm/dts/sunxi-u-boot.dtsi        |  4 +++
> > >  arch/arm/mach-sunxi/Kconfig           |  1 -
> > >  board/sunxi/board.c                   | 15 ++++++++++
> > >  configs/Linksprite_pcDuino3_defconfig |  1 -
> > >  drivers/clk/sunxi/clk_a10.c           |  4 +++
> > >  drivers/clk/sunxi/clk_a10s.c          |  3 ++
> > >  drivers/clk/sunxi/clk_a23.c           |  6 ++++
> > >  drivers/clk/sunxi/clk_a31.c           |  8 +++++
> > >  drivers/clk/sunxi/clk_a64.c           |  6 ++++
> > >  drivers/clk/sunxi/clk_a80.c           | 32 +++++++++++++++++++-
> > >  drivers/clk/sunxi/clk_a83t.c          |  6 ++++
> > >  drivers/clk/sunxi/clk_h3.c            |  6 ++++
> > >  drivers/clk/sunxi/clk_h6.c            |  6 ++++
> > >  drivers/clk/sunxi/clk_r40.c           |  8 +++++
> > >  drivers/clk/sunxi/clk_sunxi.c         | 12 ++++++++
> > >  drivers/clk/sunxi/clk_v3s.c           |  6 ++++
> > >  drivers/mmc/sunxi_mmc.c               | 42
> > > +++++++++++++++++++++++---- 18 files changed, 159 insertions(+), 8
> > > deletions(-)   
> > 
> >   
>
Andre Przywara Jan. 30, 2019, 1:56 p.m. UTC | #8
On Wed, 30 Jan 2019 18:20:31 +0530
Jagan Teki <jagan@amarulasolutions.com> wrote:

> On Wed, Jan 30, 2019 at 5:17 PM Andre Przywara
> <andre.przywara@arm.com> wrote:
> >
> > On Wed, 30 Jan 2019 11:16:07 +0100
> > Tomas Novotny <tomas@novotny.cz> wrote:
> >
> > Hi,
> >  
> > > On Tue, 29 Jan 2019 15:54:07 +0000, Andre Przywara
> > > <andre.przywara@arm.com> wrote:  
> > > > This series gathers all remaining patches we need to enable
> > > > DM_MMC for Allwinner boards. It relies on the clock gates
> > > > framework already merged, and adds the respective gates and
> > > > resets for each SoC. It then teaches the sunxi MMC driver to
> > > > use the clock framework for those reset and gates clocks. The
> > > > "mod clock", responsible for setting the actual interface
> > > > speed, is still handled in the MMC driver, as the DM_CLK part
> > > > of that is not ready yet (and is not trivial). This allows to
> > > > turn on DM_MMC, and gets rid of the doomsday warning message
> > > > every Allwinner board was blessed with for a while.
> > > >
> > > > This series is available at:
> > > > https://github.com/apritzel/u-boot/commits/sunxi-dm-gates  
> > >
> > > I've briefly tested that branch on A83t mainlined tablet (TBS
> > > A711). I was able to boot from SD card and eMMC.
> > >
> > > Just noticed that message:
> > > MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000'
> > > mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
> > > I guess that this is the mmc1/2 renaming stuff?  
> >
> > I think so. So is this just a warning, and it continues anyway and
> > works?
> >
> > TBH, I don't like this patch 9/9 very much, I actually believe
> > relying on this numbering scheme in /aliases is something odd and
> > fragile. Especially since Linux (and other OSes) seem to get away
> > without it.
> >
> > For MMC, can't we just enumerate them dynamically? AFAIU the MMC
> > driver would not probe a block device successfully on an SDIO
> > device, would it?
> >
> > But for the sake of having something working, I am fine with the
> > patch, at least on a for-now basis.  
> 
> It's not a simple think that 9/9 fix is for,It's something big like
> w/o that we can't get the default env and fastboot devices because we
> always assign mmc1 for these purposes and indeed mmc1 is SDIO for DT
> enumeration.

Yeah, but why is it enumerating mmc1 in the first place? It doesn't
seem to be usable? The MMC layer should know that there is no block
device behind this SDIO thing, so it shouldn't even bother with
creating a device for it. Certainly Linux works this way.

I understand that it fixes the issue, but it's some sort of hack,
especially as it's applied to all DTs.

Cheers,
Andre.