All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode
@ 2017-07-12 14:48 Maxime Ripard
  2017-07-12 14:48 ` [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T Maxime Ripard
  2017-07-12 16:27 ` [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode Siarhei Siamashka
  0 siblings, 2 replies; 14+ messages in thread
From: Maxime Ripard @ 2017-07-12 14:48 UTC (permalink / raw)
  To: u-boot

Almost all of the newer Allwinner SoCs have a new operating mode for the
eMMC clocks that needs to be enabled in both the clock and the MMC
controller.

Add support for it through a Kconfig option

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/include/asm/arch-sunxi/mmc.h |  9 ++++++---
 drivers/mmc/Kconfig                   |  3 +++
 drivers/mmc/sunxi_mmc.c               | 26 +++++++++++++++++++++++---
 3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/mmc.h b/arch/arm/include/asm/arch-sunxi/mmc.h
index cb52e648731c..0c2d496295ff 100644
--- a/arch/arm/include/asm/arch-sunxi/mmc.h
+++ b/arch/arm/include/asm/arch-sunxi/mmc.h
@@ -35,16 +35,19 @@ struct sunxi_mmc {
 	u32 cbcr;		/* 0x48 CIU byte count */
 	u32 bbcr;		/* 0x4c BIU byte count */
 	u32 dbgc;		/* 0x50 debug enable */
-	u32 res0[11];
+	u32 res0;		/* 0x54 reserved */
+	u32 a12a;		/* 0x58 Auto command 12 argument */
+	u32 ntsr;		/* 0x5c	New timing set register */
+	u32 res1[8];
 	u32 dmac;		/* 0x80 internal DMA control */
 	u32 dlba;		/* 0x84 internal DMA descr list base address */
 	u32 idst;		/* 0x88 internal DMA status */
 	u32 idie;		/* 0x8c internal DMA interrupt enable */
 	u32 chda;		/* 0x90 */
 	u32 cbda;		/* 0x94 */
-	u32 res1[26];
+	u32 res2[26];
 #ifdef CONFIG_SUNXI_GEN_SUN6I
-	u32 res2[64];
+	u32 res3[64];
 #endif
 	u32 fifo;		/* 0x100 / 0x200 FIFO access address */
 };
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 82b8d756867c..203f59547100 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -368,6 +368,9 @@ config MMC_SUNXI
 	  This selects support for the SD/MMC Host Controller on
 	  Allwinner sunxi SoCs.
 
+config MMC_SUNXI_HAS_NEW_MODE
+	bool
+
 config GENERIC_ATMEL_MCI
 	bool "Atmel Multimedia Card Interface support"
 	depends on DM_MMC && BLK && DM_MMC_OPS && ARCH_AT91
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index fd3fc2af40a0..68750f3832b6 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -87,6 +87,20 @@ static int mmc_resource_init(int sdc_no)
 static int mmc_set_mod_clk(struct sunxi_mmc_host *mmchost, unsigned int hz)
 {
 	unsigned int pll, pll_hz, div, n, oclk_dly, sclk_dly;
+	bool new_mode = false;
+	u32 val = 0;
+
+#ifdef CONFIG_MMC_SUNXI_HAS_NEW_MODE
+	if (mmchost->mmc_no == 2)
+		new_mode = true;
+#endif
+
+	/*
+	 * The MMC clock has an extra /2 post-divider when operating in the new
+	 * mode.
+	 */
+	if (new_mode)
+		hz = hz * 2;
 
 	if (hz <= 24000000) {
 		pll = CCM_MMC_CTRL_OSCM24;
@@ -143,9 +157,15 @@ static int mmc_set_mod_clk(struct sunxi_mmc_host *mmchost, unsigned int hz)
 #endif
 	}
 
-	writel(CCM_MMC_CTRL_ENABLE | pll | CCM_MMC_CTRL_SCLK_DLY(sclk_dly) |
-	       CCM_MMC_CTRL_N(n) | CCM_MMC_CTRL_OCLK_DLY(oclk_dly) |
-	       CCM_MMC_CTRL_M(div), mmchost->mclkreg);
+	if (new_mode) {
+		val = BIT(30);
+		writel(BIT(31), &mmchost->reg->ntsr);
+	} else {
+		val = CCM_MMC_CTRL_OCLK_DLY(oclk_dly) | CCM_MMC_CTRL_SCLK_DLY(sclk_dly);
+	}
+
+	writel(CCM_MMC_CTRL_ENABLE| pll | CCM_MMC_CTRL_N(n) | CCM_MMC_CTRL_M(div) | val,
+	       mmchost->mclkreg);
 
 	debug("mmc %u set mod-clk req %u parent %u n %u m %u rate %u\n",
 	      mmchost->mmc_no, hz, pll_hz, 1u << n, div,
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-07-12 14:48 [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode Maxime Ripard
@ 2017-07-12 14:48 ` Maxime Ripard
  2017-07-12 16:27 ` [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode Siarhei Siamashka
  1 sibling, 0 replies; 14+ messages in thread
From: Maxime Ripard @ 2017-07-12 14:48 UTC (permalink / raw)
  To: u-boot

The eMMC controller for the A83T uses the new operating mode. Enable it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/mach-sunxi/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index bd3e7d3b3f20..867ef51918be 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -122,6 +122,7 @@ config MACH_SUN8I_A83T
 	bool "sun8i (Allwinner A83T)"
 	select CPU_V7
 	select SUNXI_GEN_SUN6I
+	select MMC_SUNXI_HAS_NEW_MODE
 	select SUPPORT_SPL
 
 config MACH_SUN8I_H3
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode
  2017-07-12 14:48 [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode Maxime Ripard
  2017-07-12 14:48 ` [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T Maxime Ripard
@ 2017-07-12 16:27 ` Siarhei Siamashka
  2017-07-17 10:00   ` Maxime Ripard
  1 sibling, 1 reply; 14+ messages in thread
From: Siarhei Siamashka @ 2017-07-12 16:27 UTC (permalink / raw)
  To: u-boot

On Wed, 12 Jul 2017 16:48:37 +0200
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:

> Almost all of the newer Allwinner SoCs have a new operating mode for the
> eMMC clocks that needs to be enabled in both the clock and the MMC
> controller.

Can we have a bit better description in the commit message about what
is new about this mode? Does it bring us some visible improvements
for the end users? Why do we need to enable it?

> 
> Add support for it through a Kconfig option
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  arch/arm/include/asm/arch-sunxi/mmc.h |  9 ++++++---
>  drivers/mmc/Kconfig                   |  3 +++
>  drivers/mmc/sunxi_mmc.c               | 26 +++++++++++++++++++++++---
>  3 files changed, 32 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-sunxi/mmc.h b/arch/arm/include/asm/arch-sunxi/mmc.h
> index cb52e648731c..0c2d496295ff 100644
> --- a/arch/arm/include/asm/arch-sunxi/mmc.h
> +++ b/arch/arm/include/asm/arch-sunxi/mmc.h
> @@ -35,16 +35,19 @@ struct sunxi_mmc {
>  	u32 cbcr;		/* 0x48 CIU byte count */
>  	u32 bbcr;		/* 0x4c BIU byte count */
>  	u32 dbgc;		/* 0x50 debug enable */
> -	u32 res0[11];
> +	u32 res0;		/* 0x54 reserved */
> +	u32 a12a;		/* 0x58 Auto command 12 argument */
> +	u32 ntsr;		/* 0x5c	New timing set register */
> +	u32 res1[8];
>  	u32 dmac;		/* 0x80 internal DMA control */
>  	u32 dlba;		/* 0x84 internal DMA descr list base address */
>  	u32 idst;		/* 0x88 internal DMA status */
>  	u32 idie;		/* 0x8c internal DMA interrupt enable */
>  	u32 chda;		/* 0x90 */
>  	u32 cbda;		/* 0x94 */
> -	u32 res1[26];
> +	u32 res2[26];
>  #ifdef CONFIG_SUNXI_GEN_SUN6I
> -	u32 res2[64];
> +	u32 res3[64];
>  #endif
>  	u32 fifo;		/* 0x100 / 0x200 FIFO access address */
>  };
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index 82b8d756867c..203f59547100 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -368,6 +368,9 @@ config MMC_SUNXI
>  	  This selects support for the SD/MMC Host Controller on
>  	  Allwinner sunxi SoCs.
>  
> +config MMC_SUNXI_HAS_NEW_MODE
> +	bool
> +
>  config GENERIC_ATMEL_MCI
>  	bool "Atmel Multimedia Card Interface support"
>  	depends on DM_MMC && BLK && DM_MMC_OPS && ARCH_AT91
> diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
> index fd3fc2af40a0..68750f3832b6 100644
> --- a/drivers/mmc/sunxi_mmc.c
> +++ b/drivers/mmc/sunxi_mmc.c
> @@ -87,6 +87,20 @@ static int mmc_resource_init(int sdc_no)
>  static int mmc_set_mod_clk(struct sunxi_mmc_host *mmchost, unsigned int hz)
>  {
>  	unsigned int pll, pll_hz, div, n, oclk_dly, sclk_dly;
> +	bool new_mode = false;
> +	u32 val = 0;
> +
> +#ifdef CONFIG_MMC_SUNXI_HAS_NEW_MODE
> +	if (mmchost->mmc_no == 2)
> +		new_mode = true;
> +#endif

Please change this ifdef to use:

    if (IS_ENABLED(CONFIG_MMC_SUNXI_HAS_NEW_MODE))

> +
> +	/*
> +	 * The MMC clock has an extra /2 post-divider when operating in the new
> +	 * mode.
> +	 */
> +	if (new_mode)
> +		hz = hz * 2;
>  
>  	if (hz <= 24000000) {
>  		pll = CCM_MMC_CTRL_OSCM24;
> @@ -143,9 +157,15 @@ static int mmc_set_mod_clk(struct sunxi_mmc_host *mmchost, unsigned int hz)
>  #endif
>  	}
>  
> -	writel(CCM_MMC_CTRL_ENABLE | pll | CCM_MMC_CTRL_SCLK_DLY(sclk_dly) |
> -	       CCM_MMC_CTRL_N(n) | CCM_MMC_CTRL_OCLK_DLY(oclk_dly) |
> -	       CCM_MMC_CTRL_M(div), mmchost->mclkreg);
> +	if (new_mode) {
> +		val = BIT(30);

Does this BIT(30) have a name?

> +		writel(BIT(31), &mmchost->reg->ntsr);

The same question here.

> +	} else {
> +		val = CCM_MMC_CTRL_OCLK_DLY(oclk_dly) | CCM_MMC_CTRL_SCLK_DLY(sclk_dly);
> +	}
> +
> +	writel(CCM_MMC_CTRL_ENABLE| pll | CCM_MMC_CTRL_N(n) | CCM_MMC_CTRL_M(div) | val,
> +	       mmchost->mclkreg);
>  
>  	debug("mmc %u set mod-clk req %u parent %u n %u m %u rate %u\n",
>  	      mmchost->mmc_no, hz, pll_hz, 1u << n, div,

-- 
Best regards,
Siarhei Siamashka

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode
  2017-07-12 16:27 ` [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode Siarhei Siamashka
@ 2017-07-17 10:00   ` Maxime Ripard
  0 siblings, 0 replies; 14+ messages in thread
From: Maxime Ripard @ 2017-07-17 10:00 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 12, 2017 at 07:27:12PM +0300, Siarhei Siamashka wrote:
> On Wed, 12 Jul 2017 16:48:37 +0200
> Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> 
> > Almost all of the newer Allwinner SoCs have a new operating mode for the
> > eMMC clocks that needs to be enabled in both the clock and the MMC
> > controller.
> 
> Can we have a bit better description in the commit message about what
> is new about this mode? Does it bring us some visible improvements
> for the end users? Why do we need to enable it?

I wish I could detail what exactly changes between the old and new
mode, but I have no idea. It seems to be different enough that it
makes eMMC works on the A83T. We also had some commands that were
failing in SDIO on the A64 if not switched to the new mode. But that's
just empirical.

> > 
> > Add support for it through a Kconfig option
> > 
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  arch/arm/include/asm/arch-sunxi/mmc.h |  9 ++++++---
> >  drivers/mmc/Kconfig                   |  3 +++
> >  drivers/mmc/sunxi_mmc.c               | 26 +++++++++++++++++++++++---
> >  3 files changed, 32 insertions(+), 6 deletions(-)
> > 
> > diff --git a/arch/arm/include/asm/arch-sunxi/mmc.h b/arch/arm/include/asm/arch-sunxi/mmc.h
> > index cb52e648731c..0c2d496295ff 100644
> > --- a/arch/arm/include/asm/arch-sunxi/mmc.h
> > +++ b/arch/arm/include/asm/arch-sunxi/mmc.h
> > @@ -35,16 +35,19 @@ struct sunxi_mmc {
> >  	u32 cbcr;		/* 0x48 CIU byte count */
> >  	u32 bbcr;		/* 0x4c BIU byte count */
> >  	u32 dbgc;		/* 0x50 debug enable */
> > -	u32 res0[11];
> > +	u32 res0;		/* 0x54 reserved */
> > +	u32 a12a;		/* 0x58 Auto command 12 argument */
> > +	u32 ntsr;		/* 0x5c	New timing set register */
> > +	u32 res1[8];
> >  	u32 dmac;		/* 0x80 internal DMA control */
> >  	u32 dlba;		/* 0x84 internal DMA descr list base address */
> >  	u32 idst;		/* 0x88 internal DMA status */
> >  	u32 idie;		/* 0x8c internal DMA interrupt enable */
> >  	u32 chda;		/* 0x90 */
> >  	u32 cbda;		/* 0x94 */
> > -	u32 res1[26];
> > +	u32 res2[26];
> >  #ifdef CONFIG_SUNXI_GEN_SUN6I
> > -	u32 res2[64];
> > +	u32 res3[64];
> >  #endif
> >  	u32 fifo;		/* 0x100 / 0x200 FIFO access address */
> >  };
> > diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> > index 82b8d756867c..203f59547100 100644
> > --- a/drivers/mmc/Kconfig
> > +++ b/drivers/mmc/Kconfig
> > @@ -368,6 +368,9 @@ config MMC_SUNXI
> >  	  This selects support for the SD/MMC Host Controller on
> >  	  Allwinner sunxi SoCs.
> >  
> > +config MMC_SUNXI_HAS_NEW_MODE
> > +	bool
> > +
> >  config GENERIC_ATMEL_MCI
> >  	bool "Atmel Multimedia Card Interface support"
> >  	depends on DM_MMC && BLK && DM_MMC_OPS && ARCH_AT91
> > diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
> > index fd3fc2af40a0..68750f3832b6 100644
> > --- a/drivers/mmc/sunxi_mmc.c
> > +++ b/drivers/mmc/sunxi_mmc.c
> > @@ -87,6 +87,20 @@ static int mmc_resource_init(int sdc_no)
> >  static int mmc_set_mod_clk(struct sunxi_mmc_host *mmchost, unsigned int hz)
> >  {
> >  	unsigned int pll, pll_hz, div, n, oclk_dly, sclk_dly;
> > +	bool new_mode = false;
> > +	u32 val = 0;
> > +
> > +#ifdef CONFIG_MMC_SUNXI_HAS_NEW_MODE
> > +	if (mmchost->mmc_no == 2)
> > +		new_mode = true;
> > +#endif
> 
> Please change this ifdef to use:
> 
>     if (IS_ENABLED(CONFIG_MMC_SUNXI_HAS_NEW_MODE))

Ok.

> > +
> > +	/*
> > +	 * The MMC clock has an extra /2 post-divider when operating in the new
> > +	 * mode.
> > +	 */
> > +	if (new_mode)
> > +		hz = hz * 2;
> >  
> >  	if (hz <= 24000000) {
> >  		pll = CCM_MMC_CTRL_OSCM24;
> > @@ -143,9 +157,15 @@ static int mmc_set_mod_clk(struct sunxi_mmc_host *mmchost, unsigned int hz)
> >  #endif
> >  	}
> >  
> > -	writel(CCM_MMC_CTRL_ENABLE | pll | CCM_MMC_CTRL_SCLK_DLY(sclk_dly) |
> > -	       CCM_MMC_CTRL_N(n) | CCM_MMC_CTRL_OCLK_DLY(oclk_dly) |
> > -	       CCM_MMC_CTRL_M(div), mmchost->mclkreg);
> > +	if (new_mode) {
> > +		val = BIT(30);
> 
> Does this BIT(30) have a name?
> 
> > +		writel(BIT(31), &mmchost->reg->ntsr);
> 
> The same question here.

I'll add defines. Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170717/7e65d513/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-23 10:03 ` [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T Maxime Ripard
  2017-08-26  6:41   ` Jagan Teki
@ 2017-08-28 17:16   ` Jagan Teki
  1 sibling, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2017-08-28 17:16 UTC (permalink / raw)
  To: u-boot

On Wed, Aug 23, 2017 at 3:33 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> The eMMC controller for the A83T uses the new operating mode. Enable it.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---

Applied to u-boot-sunxi/master

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-28  9:10               ` Maxime Ripard
@ 2017-08-28  9:14                 ` Jagan Teki
  0 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2017-08-28  9:14 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 28, 2017 at 2:40 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Mon, Aug 28, 2017 at 02:30:23PM +0530, Jagan Teki wrote:
>> On Mon, Aug 28, 2017 at 2:15 PM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > On Mon, Aug 28, 2017 at 04:12:15PM +0800, Chen-Yu Tsai wrote:
>> >> On Mon, Aug 28, 2017 at 4:05 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>> >> > On Mon, Aug 28, 2017 at 12:29 PM, Maxime Ripard
>> >> > <maxime.ripard@free-electrons.com> wrote:
>> >> >> Hi Jagan,
>> >> >>
>> >> >> On Sat, Aug 26, 2017 at 12:11:23PM +0530, Jagan Teki wrote:
>> >> >>> On Wed, Aug 23, 2017 at 3:33 PM, Maxime Ripard
>> >> >>> <maxime.ripard@free-electrons.com> wrote:
>> >> >>> > The eMMC controller for the A83T uses the new operating mode. Enable it.
>> >> >>> >
>> >> >>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> >> >>>
>> >> >>> Reviewed-by: Jagan Teki <jagan@openedev.com>
>> >> >>
>> >> >> I think both these patches should be merged in the upcoming
>> >> >> release. It's a fix for a usecase that already exists (we already
>> >> >> enable the eMMC on A83T), and it's unusable on some boards without it.
>> >> >
>> >> > But none of A83T boards were not enable eMMC yet? even sun8i-a83t.dtsi
>> >> > still need to add node. May be we can wait once all add?
>> >>
>> >> The sunxi-mmc driver does not use the device tree.
>> >>
>> >> One only needs to set CONFIG_MMC_SUNXI_SLOT_EXTRA=2 to use the eMMC.
>> >> And yes, eMMC is broken on some boards unless the new timing mode is
>> >> used.
>> >
>> > And the support is broken until "mmc: sunxi: fix legacy MMC
>> > initialisation" in my other serie is applied.
>>
>> With these patches, eMMC detected BPI-M3. But none of A83T boards have
>> CONFIG_MMC_SUNXI_SLOT_EXTRA=2 So it's better to take this once boards
>> added.
>
> That argument doesn't really stand, any user is able to modify the
> configuration themself, and experience that breakage.
>
> The fact that this is not enabled by default just make it less
> exposed, but it's still a bug that can be encountered today in a
> real-life situation.

OK, will apply these 3 for the release.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-28  9:00             ` Jagan Teki
@ 2017-08-28  9:10               ` Maxime Ripard
  2017-08-28  9:14                 ` Jagan Teki
  0 siblings, 1 reply; 14+ messages in thread
From: Maxime Ripard @ 2017-08-28  9:10 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 28, 2017 at 02:30:23PM +0530, Jagan Teki wrote:
> On Mon, Aug 28, 2017 at 2:15 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Mon, Aug 28, 2017 at 04:12:15PM +0800, Chen-Yu Tsai wrote:
> >> On Mon, Aug 28, 2017 at 4:05 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> >> > On Mon, Aug 28, 2017 at 12:29 PM, Maxime Ripard
> >> > <maxime.ripard@free-electrons.com> wrote:
> >> >> Hi Jagan,
> >> >>
> >> >> On Sat, Aug 26, 2017 at 12:11:23PM +0530, Jagan Teki wrote:
> >> >>> On Wed, Aug 23, 2017 at 3:33 PM, Maxime Ripard
> >> >>> <maxime.ripard@free-electrons.com> wrote:
> >> >>> > The eMMC controller for the A83T uses the new operating mode. Enable it.
> >> >>> >
> >> >>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> >> >>>
> >> >>> Reviewed-by: Jagan Teki <jagan@openedev.com>
> >> >>
> >> >> I think both these patches should be merged in the upcoming
> >> >> release. It's a fix for a usecase that already exists (we already
> >> >> enable the eMMC on A83T), and it's unusable on some boards without it.
> >> >
> >> > But none of A83T boards were not enable eMMC yet? even sun8i-a83t.dtsi
> >> > still need to add node. May be we can wait once all add?
> >>
> >> The sunxi-mmc driver does not use the device tree.
> >>
> >> One only needs to set CONFIG_MMC_SUNXI_SLOT_EXTRA=2 to use the eMMC.
> >> And yes, eMMC is broken on some boards unless the new timing mode is
> >> used.
> >
> > And the support is broken until "mmc: sunxi: fix legacy MMC
> > initialisation" in my other serie is applied.
> 
> With these patches, eMMC detected BPI-M3. But none of A83T boards have
> CONFIG_MMC_SUNXI_SLOT_EXTRA=2 So it's better to take this once boards
> added.

That argument doesn't really stand, any user is able to modify the
configuration themself, and experience that breakage.

The fact that this is not enabled by default just make it less
exposed, but it's still a bug that can be encountered today in a
real-life situation.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170828/9e22faea/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-28  8:45           ` Maxime Ripard
@ 2017-08-28  9:00             ` Jagan Teki
  2017-08-28  9:10               ` Maxime Ripard
  0 siblings, 1 reply; 14+ messages in thread
From: Jagan Teki @ 2017-08-28  9:00 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 28, 2017 at 2:15 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Mon, Aug 28, 2017 at 04:12:15PM +0800, Chen-Yu Tsai wrote:
>> On Mon, Aug 28, 2017 at 4:05 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>> > On Mon, Aug 28, 2017 at 12:29 PM, Maxime Ripard
>> > <maxime.ripard@free-electrons.com> wrote:
>> >> Hi Jagan,
>> >>
>> >> On Sat, Aug 26, 2017 at 12:11:23PM +0530, Jagan Teki wrote:
>> >>> On Wed, Aug 23, 2017 at 3:33 PM, Maxime Ripard
>> >>> <maxime.ripard@free-electrons.com> wrote:
>> >>> > The eMMC controller for the A83T uses the new operating mode. Enable it.
>> >>> >
>> >>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> >>>
>> >>> Reviewed-by: Jagan Teki <jagan@openedev.com>
>> >>
>> >> I think both these patches should be merged in the upcoming
>> >> release. It's a fix for a usecase that already exists (we already
>> >> enable the eMMC on A83T), and it's unusable on some boards without it.
>> >
>> > But none of A83T boards were not enable eMMC yet? even sun8i-a83t.dtsi
>> > still need to add node. May be we can wait once all add?
>>
>> The sunxi-mmc driver does not use the device tree.
>>
>> One only needs to set CONFIG_MMC_SUNXI_SLOT_EXTRA=2 to use the eMMC.
>> And yes, eMMC is broken on some boards unless the new timing mode is
>> used.
>
> And the support is broken until "mmc: sunxi: fix legacy MMC
> initialisation" in my other serie is applied.

With these patches, eMMC detected BPI-M3. But none of A83T boards have
CONFIG_MMC_SUNXI_SLOT_EXTRA=2 So it's better to take this once boards
added.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-28  8:12         ` Chen-Yu Tsai
@ 2017-08-28  8:45           ` Maxime Ripard
  2017-08-28  9:00             ` Jagan Teki
  0 siblings, 1 reply; 14+ messages in thread
From: Maxime Ripard @ 2017-08-28  8:45 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 28, 2017 at 04:12:15PM +0800, Chen-Yu Tsai wrote:
> On Mon, Aug 28, 2017 at 4:05 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> > On Mon, Aug 28, 2017 at 12:29 PM, Maxime Ripard
> > <maxime.ripard@free-electrons.com> wrote:
> >> Hi Jagan,
> >>
> >> On Sat, Aug 26, 2017 at 12:11:23PM +0530, Jagan Teki wrote:
> >>> On Wed, Aug 23, 2017 at 3:33 PM, Maxime Ripard
> >>> <maxime.ripard@free-electrons.com> wrote:
> >>> > The eMMC controller for the A83T uses the new operating mode. Enable it.
> >>> >
> >>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> >>>
> >>> Reviewed-by: Jagan Teki <jagan@openedev.com>
> >>
> >> I think both these patches should be merged in the upcoming
> >> release. It's a fix for a usecase that already exists (we already
> >> enable the eMMC on A83T), and it's unusable on some boards without it.
> >
> > But none of A83T boards were not enable eMMC yet? even sun8i-a83t.dtsi
> > still need to add node. May be we can wait once all add?
> 
> The sunxi-mmc driver does not use the device tree.
> 
> One only needs to set CONFIG_MMC_SUNXI_SLOT_EXTRA=2 to use the eMMC.
> And yes, eMMC is broken on some boards unless the new timing mode is
> used.

And the support is broken until "mmc: sunxi: fix legacy MMC
initialisation" in my other serie is applied.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170828/b1d323f0/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-28  8:05       ` Jagan Teki
@ 2017-08-28  8:12         ` Chen-Yu Tsai
  2017-08-28  8:45           ` Maxime Ripard
  0 siblings, 1 reply; 14+ messages in thread
From: Chen-Yu Tsai @ 2017-08-28  8:12 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 28, 2017 at 4:05 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> On Mon, Aug 28, 2017 at 12:29 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
>> Hi Jagan,
>>
>> On Sat, Aug 26, 2017 at 12:11:23PM +0530, Jagan Teki wrote:
>>> On Wed, Aug 23, 2017 at 3:33 PM, Maxime Ripard
>>> <maxime.ripard@free-electrons.com> wrote:
>>> > The eMMC controller for the A83T uses the new operating mode. Enable it.
>>> >
>>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>>>
>>> Reviewed-by: Jagan Teki <jagan@openedev.com>
>>
>> I think both these patches should be merged in the upcoming
>> release. It's a fix for a usecase that already exists (we already
>> enable the eMMC on A83T), and it's unusable on some boards without it.
>
> But none of A83T boards were not enable eMMC yet? even sun8i-a83t.dtsi
> still need to add node. May be we can wait once all add?

The sunxi-mmc driver does not use the device tree.

One only needs to set CONFIG_MMC_SUNXI_SLOT_EXTRA=2 to use the eMMC.
And yes, eMMC is broken on some boards unless the new timing mode is
used.

ChenYu

> # grep -R 83T configs/
> configs/Sinovoip_BPI_M3_defconfig:CONFIG_MACH_SUN8I_A83T=y
> configs/h8_homlet_v2_defconfig:CONFIG_MACH_SUN8I_A83T=y
> configs/Cubietruck_plus_defconfig:CONFIG_MACH_SUN8I_A83T=y

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-28  6:59     ` Maxime Ripard
@ 2017-08-28  8:05       ` Jagan Teki
  2017-08-28  8:12         ` Chen-Yu Tsai
  0 siblings, 1 reply; 14+ messages in thread
From: Jagan Teki @ 2017-08-28  8:05 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 28, 2017 at 12:29 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi Jagan,
>
> On Sat, Aug 26, 2017 at 12:11:23PM +0530, Jagan Teki wrote:
>> On Wed, Aug 23, 2017 at 3:33 PM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > The eMMC controller for the A83T uses the new operating mode. Enable it.
>> >
>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>>
>> Reviewed-by: Jagan Teki <jagan@openedev.com>
>
> I think both these patches should be merged in the upcoming
> release. It's a fix for a usecase that already exists (we already
> enable the eMMC on A83T), and it's unusable on some boards without it.

But none of A83T boards were not enable eMMC yet? even sun8i-a83t.dtsi
still need to add node. May be we can wait once all add?

# grep -R 83T configs/
configs/Sinovoip_BPI_M3_defconfig:CONFIG_MACH_SUN8I_A83T=y
configs/h8_homlet_v2_defconfig:CONFIG_MACH_SUN8I_A83T=y
configs/Cubietruck_plus_defconfig:CONFIG_MACH_SUN8I_A83T=y

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-26  6:41   ` Jagan Teki
@ 2017-08-28  6:59     ` Maxime Ripard
  2017-08-28  8:05       ` Jagan Teki
  0 siblings, 1 reply; 14+ messages in thread
From: Maxime Ripard @ 2017-08-28  6:59 UTC (permalink / raw)
  To: u-boot

Hi Jagan,

On Sat, Aug 26, 2017 at 12:11:23PM +0530, Jagan Teki wrote:
> On Wed, Aug 23, 2017 at 3:33 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > The eMMC controller for the A83T uses the new operating mode. Enable it.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> 
> Reviewed-by: Jagan Teki <jagan@openedev.com>

I think both these patches should be merged in the upcoming
release. It's a fix for a usecase that already exists (we already
enable the eMMC on A83T), and it's unusable on some boards without it.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170828/899a3221/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-23 10:03 ` [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T Maxime Ripard
@ 2017-08-26  6:41   ` Jagan Teki
  2017-08-28  6:59     ` Maxime Ripard
  2017-08-28 17:16   ` Jagan Teki
  1 sibling, 1 reply; 14+ messages in thread
From: Jagan Teki @ 2017-08-26  6:41 UTC (permalink / raw)
  To: u-boot

On Wed, Aug 23, 2017 at 3:33 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> The eMMC controller for the A83T uses the new operating mode. Enable it.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---

Reviewed-by: Jagan Teki <jagan@openedev.com>

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T
  2017-08-23 10:03 [U-Boot] [PATCH v2 1/2] mmc: sunxi: Support " Maxime Ripard
@ 2017-08-23 10:03 ` Maxime Ripard
  2017-08-26  6:41   ` Jagan Teki
  2017-08-28 17:16   ` Jagan Teki
  0 siblings, 2 replies; 14+ messages in thread
From: Maxime Ripard @ 2017-08-23 10:03 UTC (permalink / raw)
  To: u-boot

The eMMC controller for the A83T uses the new operating mode. Enable it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/mach-sunxi/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 94412bac0c1d..8d56d591d97a 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -127,6 +127,7 @@ config MACH_SUN8I_A83T
 	bool "sun8i (Allwinner A83T)"
 	select CPU_V7
 	select SUNXI_GEN_SUN6I
+	select MMC_SUNXI_HAS_NEW_MODE
 	select SUPPORT_SPL
 
 config MACH_SUN8I_H3
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-08-28 17:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-12 14:48 [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode Maxime Ripard
2017-07-12 14:48 ` [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T Maxime Ripard
2017-07-12 16:27 ` [U-Boot] [PATCH 1/2] mmc: sunxi: Support the new mode Siarhei Siamashka
2017-07-17 10:00   ` Maxime Ripard
2017-08-23 10:03 [U-Boot] [PATCH v2 1/2] mmc: sunxi: Support " Maxime Ripard
2017-08-23 10:03 ` [U-Boot] [PATCH 2/2] sunxi: Enable MMC new mode for A83T Maxime Ripard
2017-08-26  6:41   ` Jagan Teki
2017-08-28  6:59     ` Maxime Ripard
2017-08-28  8:05       ` Jagan Teki
2017-08-28  8:12         ` Chen-Yu Tsai
2017-08-28  8:45           ` Maxime Ripard
2017-08-28  9:00             ` Jagan Teki
2017-08-28  9:10               ` Maxime Ripard
2017-08-28  9:14                 ` Jagan Teki
2017-08-28 17:16   ` Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.