Skip to contentSkip to conversation

Odroid n2 using eMMC would fail to boot up

PATCH Superseded Anand Moon 3 participants 12 messages Jan 22, 2020 – Feb 2, 2020

Subsystems (3)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Anand Moon

author
#0 lore raw

v4 cover Odroid n2 using eMMC would fail to boot up

Here are some small changes to fix booting of Odroid N2 using eMMC. Fixed the clk tunnig during mmc initialization.
Added two new patches to fix warning

Build and tested on top of below patches
[0] https://patchwork.ozlabs.org/patch/1213648/
[1] https://patchwork.ozlabs.org/patch/1213650/

Tested on below eMMC module on Odroid N2 and C2
new orange - eMMC AJNB4R 14.6 GiB MMC 5.1
old back - eMMC CGND3R 58.2 GiB MMC 5.0

Prevoius changes:
Fixed the clk tuning as per mainline kernel

[3]v1 https://patchwork.ozlabs.org/cover/1201206/
[4]v2 https://patchwork.ozlabs.org/cover/1215217/
[5]v3 https://www.mail-archive.com/u-boot at lists.denx.de/msg351859.html

-Anand

Anand Moon (3):
mmc: meson-gx: Fix clk phase tuning for MMC
arm: dts: Add mmc alias to avoid warning
arm: dts: Add cd-gpio for eMMC

 arch/arm/dts/meson-axg-s400.dts               |  2 +
 arch/arm/dts/meson-g12a-sei510.dts            |  3 ++
 arch/arm/dts/meson-g12a-u200.dts              |  3 ++
 arch/arm/dts/meson-g12b-odroid-n2.dts         |  4 ++
 arch/arm/dts/meson-gxbb-odroidc2.dts          |  3 ++
 arch/arm/dts/meson-gxbb-p20x.dtsi             |  3 ++
 arch/arm/dts/meson-gxl-s805x-libretech-ac.dts |  3 ++
 arch/arm/dts/meson-gxl-s905x-p212.dtsi        |  3 ++
 arch/arm/dts/meson-gxm-khadas-vim2.dts        |  3 ++
 arch/arm/dts/meson-sm1-sei610.dts             |  3 ++
 arch/arm/include/asm/arch-meson/sd_emmc.h     | 11 ++----
 drivers/mmc/meson_gx_mmc.c                    | 38 ++++++++++++++++---
 12 files changed, 65 insertions(+), 14 deletions(-)
Signature · 1 line
2.25.0
author
#1 lore raw

PATCH v4 1/3 mmc: meson-gx: Fix clk phase tuning for MMC

As per mainline line kernel fix the clk tunig phase for mmc, set Core=180, Tx=180, Rx=0 clk phase for mmc initialization. As per S905X and S922X datasheet set the default values for clk tuning.

---
Changes from previous
v3 Fix the initialization of core clk tunning phase as per datasheet.
Fix the commit message.

v2: Fix the clk phase macro to support PHASE_180
drop the wrong CLK_CORE_PHASE_MASK macro.

v1: use the mainline kernel tuning for clk tuning.

Fixed the commmit messages.
Patch v1:
https://patchwork.ozlabs.org/patch/1201208/

Before these changes.

    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
After these changes
    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
    clock is enabled (52000000Hz)
Test on Odroid N2 and Odroid C2 with eMMC and microSD cards
---
 arch/arm/include/asm/arch-meson/sd_emmc.h | 11 ++-----
 drivers/mmc/meson_gx_mmc.c                | 38 +++++++++++++++++++----
 2 files changed, 35 insertions(+), 14 deletions(-)
arch/arm/include/asm/arch-meson/sd_emmc.h +3 -8
index e3a72c8b66..c193547aad 100644
@@ -7,6 +7,7 @@
 #define __SD_EMMC_H__
 
 #include <mmc.h>
+#include <linux/bitops.h>
 
 #define SDIO_PORT_A			0
 #define SDIO_PORT_B			1
@@ -19,14 +20,8 @@
 #define   CLK_MAX_DIV			63
 #define   CLK_SRC_24M			(0 << 6)
 #define   CLK_SRC_DIV2			(1 << 6)
-#define   CLK_CO_PHASE_000		(0 << 8)
-#define   CLK_CO_PHASE_090		(1 << 8)
-#define   CLK_CO_PHASE_180		(2 << 8)
-#define   CLK_CO_PHASE_270		(3 << 8)
-#define   CLK_TX_PHASE_000		(0 << 10)
-#define   CLK_TX_PHASE_090		(1 << 10)
-#define   CLK_TX_PHASE_180		(2 << 10)
-#define   CLK_TX_PHASE_270		(3 << 10)
+#define	  UPDATE(x, h, l)		(((x) << (l)) & GENMASK((h), (l)))
+
 #define   CLK_ALWAYS_ON			BIT(24)
 
 #define MESON_SD_EMMC_CFG		0x44
drivers/mmc/meson_gx_mmc.c +32 -6
index 86c1a7164a..67b1b075ab 100644
@@ -51,12 +51,38 @@ static void meson_mmc_config_clock(struct mmc *mmc)
 	}
 	clk_div = DIV_ROUND_UP(clk, mmc->clock);
 
-	/* 180 phase core clock */
-	meson_mmc_clk |= CLK_CO_PHASE_180;
-
-	/* 180 phase tx clock */
-	meson_mmc_clk |= CLK_TX_PHASE_000;
-
+	/* Clock divider */
+	meson_mmc_clk = GENMASK(5, 0);
+	/* Clock source 1: Fix PLL, 1000MHz */
+	meson_mmc_clk |= UPDATE(1, 7, 6);
+	/* Core clock phase 2:180 */
+	meson_mmc_clk |= UPDATE(2, 9, 8);
+	/* TX clock phase 2:180 */
+	meson_mmc_clk |= UPDATE(2, 11, 10);
+	/* RX clock phase 0:180 */
+	meson_mmc_clk |= UPDATE(0, 13, 12);
+#ifdef CONFIG_MESON_GX
+	/* TX clock delay line */
+	meson_mmc_clk |= GENMASK(19, 16);
+	/* RX clock delay line */
+	meson_mmc_clk |= GENMASK(23, 20);
+	/* clk always on */
+	meson_mmc_clk |= BIT(20);
+	/* clk irq sdio sleep */
+	meson_mmc_clk |= BIT(25);
+#endif
+#if (defined(CONFIG_MESON_AXG) || defined(CONFIG_MESON_G12A))
+	/* TX clock delay line */
+	meson_mmc_clk |=  GENMASK(21, 16);
+	/* RX clock delay line */
+	meson_mmc_clk |=  GENMASK(27, 22);
+	/* clk always on */
+	meson_mmc_clk |= BIT(28);
+	/* clk irq sdio sleep */
+	meson_mmc_clk |= BIT(29);
+	/* clk irq sdio sleep_ds */
+	meson_mmc_clk |= BIT(30);
+#endif
 	/* clock settings */
 	meson_mmc_clk |= clk_src;
 	meson_mmc_clk |= clk_div;
Signature · 1 line
2.25.0
#2 lore raw

PATCH v4 1/3 mmc: meson-gx: Fix clk phase tuning for MMC

Dear Anand,

Quoted 85 lines · Anand Moon

As per mainline line kernel fix the clk tunig phase for mmc, set Core=180, Tx=180, Rx=0 clk phase for mmc initialization. As per S905X and S922X datasheet set the default values for clk tuning.

---
Changes from previous
v3 Fix the initialization of core clk tunning phase as per datasheet.
Fix the commit message.

v2: Fix the clk phase macro to support PHASE_180
drop the wrong CLK_CORE_PHASE_MASK macro.

v1: use the mainline kernel tuning for clk tuning.

Fixed the commmit messages.
Patch v1:
https://protect2.fireeye.com/url?k=c4a34ac1-9973420d-c4a2c18e-000babff3793-f192c82d705776ae&u=https://patchwork.ozlabs.org/patch/1201208/

Before these changes.

    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
After these changes
    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
    clock is enabled (52000000Hz)
Test on Odroid N2 and Odroid C2 with eMMC and microSD cards
---
 arch/arm/include/asm/arch-meson/sd_emmc.h | 11 ++-----
 drivers/mmc/meson_gx_mmc.c                | 38 +++++++++++++++++++----
 2 files changed, 35 insertions(+), 14 deletions(-)
arch/arm/include/asm/arch-meson/sd_emmc.h +3 -8
index e3a72c8b66..c193547aad 100644
@@ -7,6 +7,7 @@
 #define __SD_EMMC_H__
 
 #include <mmc.h>
+#include <linux/bitops.h>
 
 #define SDIO_PORT_A			0
 #define SDIO_PORT_B			1
@@ -19,14 +20,8 @@
 #define   CLK_MAX_DIV			63
 #define   CLK_SRC_24M			(0 << 6)
 #define   CLK_SRC_DIV2			(1 << 6)
-#define   CLK_CO_PHASE_000		(0 << 8)
-#define   CLK_CO_PHASE_090		(1 << 8)
-#define   CLK_CO_PHASE_180		(2 << 8)
-#define   CLK_CO_PHASE_270		(3 << 8)
-#define   CLK_TX_PHASE_000		(0 << 10)
-#define   CLK_TX_PHASE_090		(1 << 10)
-#define   CLK_TX_PHASE_180		(2 << 10)
-#define   CLK_TX_PHASE_270		(3 << 10)
+#define	  UPDATE(x, h, l)		(((x) << (l)) & GENMASK((h), (l)))
+
 #define   CLK_ALWAYS_ON			BIT(24)
 
 #define MESON_SD_EMMC_CFG		0x44
drivers/mmc/meson_gx_mmc.c +9 -6
index 86c1a7164a..67b1b075ab 100644
@@ -51,12 +51,38 @@ static void meson_mmc_config_clock(struct mmc *mmc)
 	}
 	clk_div = DIV_ROUND_UP(clk, mmc->clock);
 
-	/* 180 phase core clock */
-	meson_mmc_clk |= CLK_CO_PHASE_180;
-
-	/* 180 phase tx clock */
-	meson_mmc_clk |= CLK_TX_PHASE_000;
-
+	/* Clock divider */
+	meson_mmc_clk = GENMASK(5, 0);
+	/* Clock source 1: Fix PLL, 1000MHz */
+	meson_mmc_clk |= UPDATE(1, 7, 6);
+	/* Core clock phase 2:180 */
+	meson_mmc_clk |= UPDATE(2, 9, 8);
+	/* TX clock phase 2:180 */
+	meson_mmc_clk |= UPDATE(2, 11, 10);
+	/* RX clock phase 0:180 */

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 72

Quoted 10 lines
drivers/mmc/meson_gx_mmc.c +10 -0
+	meson_mmc_clk |= UPDATE(0, 13, 12);
+#ifdef CONFIG_MESON_GX
+	/* TX clock delay line */
+	meson_mmc_clk |= GENMASK(19, 16);
+	/* RX clock delay line */
+	meson_mmc_clk |= GENMASK(23, 20);
+	/* clk always on */
+	meson_mmc_clk |= BIT(20);
+	/* clk irq sdio sleep */
+	meson_mmc_clk |= BIT(25);

Could you define the macro instead of BIT(x)?
It's helpful to know what its bit is used.

e.g) #define CLK_ALWAYS_ON BIT(20)

i didn't know that BIT(20)/(25) are defined as what purpose has.

Best Regards,
Jaehoon Chung

Quoted 17 lines
drivers/mmc/meson_gx_mmc.c +13 -0
+#endif
+#if (defined(CONFIG_MESON_AXG) || defined(CONFIG_MESON_G12A))
+	/* TX clock delay line */
+	meson_mmc_clk |=  GENMASK(21, 16);
+	/* RX clock delay line */
+	meson_mmc_clk |=  GENMASK(27, 22);
+	/* clk always on */
+	meson_mmc_clk |= BIT(28);
+	/* clk irq sdio sleep */
+	meson_mmc_clk |= BIT(29);
+	/* clk irq sdio sleep_ds */
+	meson_mmc_clk |= BIT(30);
+#endif
 	/* clock settings */
 	meson_mmc_clk |= clk_src;
 	meson_mmc_clk |= clk_div;
author
#3 lore raw

PATCH v4 1/3 mmc: meson-gx: Fix clk phase tuning for MMC

Hi Jaehoon,

Quoted 88 lines · Jaehoon Chung

Dear Anand,

Quoted 84 lines · Anand Moon

As per mainline line kernel fix the clk tunig phase for mmc, set Core=180, Tx=180, Rx=0 clk phase for mmc initialization. As per S905X and S922X datasheet set the default values for clk tuning.

---
Changes from previous
v3 Fix the initialization of core clk tunning phase as per datasheet.
Fix the commit message.

v2: Fix the clk phase macro to support PHASE_180
drop the wrong CLK_CORE_PHASE_MASK macro.

v1: use the mainline kernel tuning for clk tuning.

Fixed the commmit messages.
Patch v1:
https://protect2.fireeye.com/url?k=c4a34ac1-9973420d-c4a2c18e-000babff3793-f192c82d705776ae&u=https://patchwork.ozlabs.org/patch/1201208/

Before these changes.

    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
After these changes
    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
    clock is enabled (52000000Hz)
Test on Odroid N2 and Odroid C2 with eMMC and microSD cards
---
 arch/arm/include/asm/arch-meson/sd_emmc.h | 11 ++-----
 drivers/mmc/meson_gx_mmc.c                | 38 +++++++++++++++++++----
 2 files changed, 35 insertions(+), 14 deletions(-)
arch/arm/include/asm/arch-meson/sd_emmc.h +3 -8
index e3a72c8b66..c193547aad 100644
@@ -7,6 +7,7 @@
 #define __SD_EMMC_H__
 
 #include <mmc.h>
+#include <linux/bitops.h>
 
 #define SDIO_PORT_A                  0
 #define SDIO_PORT_B                  1
@@ -19,14 +20,8 @@
 #define   CLK_MAX_DIV                        63
 #define   CLK_SRC_24M                        (0 << 6)
 #define   CLK_SRC_DIV2                       (1 << 6)
-#define   CLK_CO_PHASE_000           (0 << 8)
-#define   CLK_CO_PHASE_090           (1 << 8)
-#define   CLK_CO_PHASE_180           (2 << 8)
-#define   CLK_CO_PHASE_270           (3 << 8)
-#define   CLK_TX_PHASE_000           (0 << 10)
-#define   CLK_TX_PHASE_090           (1 << 10)
-#define   CLK_TX_PHASE_180           (2 << 10)
-#define   CLK_TX_PHASE_270           (3 << 10)
+#define        UPDATE(x, h, l)               (((x) << (l)) & GENMASK((h), (l)))
+
 #define   CLK_ALWAYS_ON                      BIT(24)
 
 #define MESON_SD_EMMC_CFG            0x44
drivers/mmc/meson_gx_mmc.c +8 -6
index 86c1a7164a..67b1b075ab 100644
@@ -51,12 +51,38 @@ static void meson_mmc_config_clock(struct mmc *mmc)
      }
      clk_div = DIV_ROUND_UP(clk, mmc->clock);
 
-     /* 180 phase core clock */
-     meson_mmc_clk |= CLK_CO_PHASE_180;
-
-     /* 180 phase tx clock */
-     meson_mmc_clk |= CLK_TX_PHASE_000;
-
+     /* Clock divider */
+     meson_mmc_clk = GENMASK(5, 0);
+     /* Clock source 1: Fix PLL, 1000MHz */
+     meson_mmc_clk |= UPDATE(1, 7, 6);
+     /* Core clock phase 2:180 */
+     meson_mmc_clk |= UPDATE(2, 9, 8);
+     /* TX clock phase 2:180 */
+     meson_mmc_clk |= UPDATE(2, 11, 10);
Quoted 8 lines

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 69

Quoted 8 lines
drivers/mmc/meson_gx_mmc.c +8 -0
+     /* RX clock phase 0:180 */
+     meson_mmc_clk |= UPDATE(0, 13, 12);
+#ifdef CONFIG_MESON_GX
+     /* TX clock delay line */
+     meson_mmc_clk |= GENMASK(19, 16);
+     /* RX clock delay line */
+     meson_mmc_clk |= GENMASK(23, 20);
+     /* clk always on */

Opps Typo this should be BIT(24)

Quoted 7 lines

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 72

Quoted 3 lines
drivers/mmc/meson_gx_mmc.c +3 -0
+     meson_mmc_clk |= BIT(20);
+     /* clk irq sdio sleep */
+     meson_mmc_clk |= BIT(25);

Could you define the macro instead of BIT(x)?
It's helpful to know what its bit is used.

Quoted 6 lines

e.g) #define CLK_ALWAYS_ON BIT(20)

i didn't know that BIT(20)/(25) are defined as what purpose has.

Best Regards,
Jaehoon Chung

Thanks for your review.
Their are different bit setting for CLK_ALWAYS_ON on BIT(24) for (S905. S905X) and BIT(28) for S922X.
I will change this as per your suggestion in the next version Lets wait for more comments on this patch.

-Anand

Quoted 19 lines
Quoted 18 lines
drivers/mmc/meson_gx_mmc.c +13 -0
+#endif
+#if (defined(CONFIG_MESON_AXG) || defined(CONFIG_MESON_G12A))
+     /* TX clock delay line */
+     meson_mmc_clk |=  GENMASK(21, 16);
+     /* RX clock delay line */
+     meson_mmc_clk |=  GENMASK(27, 22);
+     /* clk always on */
+     meson_mmc_clk |= BIT(28);
+     /* clk irq sdio sleep */
+     meson_mmc_clk |= BIT(29);
+     /* clk irq sdio sleep_ds */
+     meson_mmc_clk |= BIT(30);
+#endif
      /* clock settings */
      meson_mmc_clk |= clk_src;
      meson_mmc_clk |= clk_div;
#4 lore raw

PATCH v4 1/3 mmc: meson-gx: Fix clk phase tuning for MMC

In reply to Anand Moon
Quoted 4 lines · Anand Moon

As per mainline line kernel fix the clk tunig phase for mmc, set Core=180, Tx=180, Rx=0 clk phase for mmc initialization. As per S905X and S922X datasheet set the default values for clk tuning.

Please add you also add AXG/G12 setup.

Quoted 44 lines

---
Changes from previous
v3 Fix the initialization of core clk tunning phase as per datasheet.
Fix the commit message.

v2: Fix the clk phase macro to support PHASE_180
drop the wrong CLK_CORE_PHASE_MASK macro.

v1: use the mainline kernel tuning for clk tuning.

Fixed the commmit messages.
Patch v1:
https://patchwork.ozlabs.org/patch/1201208/

Before these changes.

    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
After these changes
    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
    clock is enabled (52000000Hz)
Test on Odroid N2 and Odroid C2 with eMMC and microSD cards
---
 arch/arm/include/asm/arch-meson/sd_emmc.h | 11 ++-----
 drivers/mmc/meson_gx_mmc.c                | 38 +++++++++++++++++++----
 2 files changed, 35 insertions(+), 14 deletions(-)
arch/arm/include/asm/arch-meson/sd_emmc.h +1 -0
index e3a72c8b66..c193547aad 100644
@@ -7,6 +7,7 @@
 #define __SD_EMMC_H__
 
 #include <mmc.h>
+#include <linux/bitops.h>
 
 #define SDIO_PORT_A			0
 #define SDIO_PORT_B			1
@@ -19,14 +20,8 @@
 #define   CLK_MAX_DIV			63
 #define   CLK_SRC_24M			(0 << 6)

arch/arm/include/asm/arch-meson/sd_emmc.h line 23

Quoted 10 lines
arch/arm/include/asm/arch-meson/sd_emmc.h +1 -8
 #define   CLK_SRC_DIV2			(1 << 6)
-#define   CLK_CO_PHASE_000		(0 << 8)
-#define   CLK_CO_PHASE_090		(1 << 8)
-#define   CLK_CO_PHASE_180		(2 << 8)
-#define   CLK_CO_PHASE_270		(3 << 8)
-#define   CLK_TX_PHASE_000		(0 << 10)
-#define   CLK_TX_PHASE_090		(1 << 10)
-#define   CLK_TX_PHASE_180		(2 << 10)
-#define   CLK_TX_PHASE_270		(3 << 10)
+#define	  UPDATE(x, h, l)		(((x) << (l)) & GENMASK((h), (l)))

A macro already exists for that: FIELD_PREP(), please use it with proper BIT and GENMASK defines.

Quoted 39 lines
arch/arm/include/asm/arch-meson/sd_emmc.h +1 -0
+
 #define   CLK_ALWAYS_ON			BIT(24)
 
 #define MESON_SD_EMMC_CFG		0x44
drivers/mmc/meson_gx_mmc.c +21 -6
index 86c1a7164a..67b1b075ab 100644
@@ -51,12 +51,38 @@ static void meson_mmc_config_clock(struct mmc *mmc)
 	}
 	clk_div = DIV_ROUND_UP(clk, mmc->clock);
 
-	/* 180 phase core clock */
-	meson_mmc_clk |= CLK_CO_PHASE_180;
-
-	/* 180 phase tx clock */
-	meson_mmc_clk |= CLK_TX_PHASE_000;
-
+	/* Clock divider */
+	meson_mmc_clk = GENMASK(5, 0);
+	/* Clock source 1: Fix PLL, 1000MHz */
+	meson_mmc_clk |= UPDATE(1, 7, 6);
+	/* Core clock phase 2:180 */
+	meson_mmc_clk |= UPDATE(2, 9, 8);
+	/* TX clock phase 2:180 */
+	meson_mmc_clk |= UPDATE(2, 11, 10);
+	/* RX clock phase 0:180 */
+	meson_mmc_clk |= UPDATE(0, 13, 12);
+#ifdef CONFIG_MESON_GX
+	/* TX clock delay line */
+	meson_mmc_clk |= GENMASK(19, 16);
+	/* RX clock delay line */
+	meson_mmc_clk |= GENMASK(23, 20);
+	/* clk always on */
+	meson_mmc_clk |= BIT(20);
+	/* clk irq sdio sleep */
+	meson_mmc_clk |= BIT(25);
+#endif
+#if (defined(CONFIG_MESON_AXG) || defined(CONFIG_MESON_G12A))

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 84

Quoted 10 lines
drivers/mmc/meson_gx_mmc.c +10 -0
+	/* TX clock delay line */
+	meson_mmc_clk |=  GENMASK(21, 16);
+	/* RX clock delay line */
+	meson_mmc_clk |=  GENMASK(27, 22);
+	/* clk always on */
+	meson_mmc_clk |= BIT(28);
+	/* clk irq sdio sleep */
+	meson_mmc_clk |= BIT(29);
+	/* clk irq sdio sleep_ds */
+	meson_mmc_clk |= BIT(30);

As Jaehoon wrote, please define these MASKs and BITs

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 85

Quoted 1 line
drivers/mmc/meson_gx_mmc.c +1 -0
+#endif

Instead of ifdef, please add a data in the compatible list and use thez fact we use amlogic,meson-axg-mmc on AXG & G12/SM1.

Example: https://github.com/u-boot/u-boot/blob/master/drivers/video/meson/meson_vpu.c#L98
and https://github.com/u-boot/u-boot/blob/master/drivers/video/meson/meson_vpu.c#L37

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 88

Quoted 4 lines
drivers/mmc/meson_gx_mmc.c +0 -0
 	/* clock settings */
 	meson_mmc_clk |= clk_src;
 	meson_mmc_clk |= clk_div;

Thanks,
Neil

author
#5 lore raw

PATCH v4 1/3 mmc: meson-gx: Fix clk phase tuning for MMC

Hi Neil,

Quoted 10 lines · Neil Armstrong
Quoted 4 lines · Anand Moon

As per mainline line kernel fix the clk tunig phase for mmc, set Core=180, Tx=180, Rx=0 clk phase for mmc initialization. As per S905X and S922X datasheet set the default values for clk tuning.

Please add you also add AXG/G12 setup.

Ok.

Quoted 49 lines
Quoted 49 lines

---
Changes from previous
v3 Fix the initialization of core clk tunning phase as per datasheet.
Fix the commit message.

v2: Fix the clk phase macro to support PHASE_180
drop the wrong CLK_CORE_PHASE_MASK macro.

v1: use the mainline kernel tuning for clk tuning.

Fixed the commmit messages.
Patch v1:
https://patchwork.ozlabs.org/patch/1201208/

Before these changes.

    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
After these changes
    clock is enabled (380953Hz)
    clock is enabled (25000000Hz)
    clock is enabled (52000000Hz)
Test on Odroid N2 and Odroid C2 with eMMC and microSD cards
---
 arch/arm/include/asm/arch-meson/sd_emmc.h | 11 ++-----
 drivers/mmc/meson_gx_mmc.c                | 38 +++++++++++++++++++----
 2 files changed, 35 insertions(+), 14 deletions(-)
arch/arm/include/asm/arch-meson/sd_emmc.h +1 -3
index e3a72c8b66..c193547aad 100644
@@ -7,6 +7,7 @@
 #define __SD_EMMC_H__
 
 #include <mmc.h>
+#include <linux/bitops.h>
 
 #define SDIO_PORT_A                  0
 #define SDIO_PORT_B                  1
@@ -19,14 +20,8 @@
 #define   CLK_MAX_DIV                        63
 #define   CLK_SRC_24M                        (0 << 6)
 #define   CLK_SRC_DIV2                       (1 << 6)
-#define   CLK_CO_PHASE_000           (0 << 8)
-#define   CLK_CO_PHASE_090           (1 << 8)
-#define   CLK_CO_PHASE_180           (2 << 8)
Quoted 9 lines

arch/arm/include/asm/arch-meson/sd_emmc.h line 23

Quoted 6 lines
arch/arm/include/asm/arch-meson/sd_emmc.h +1 -5
-#define   CLK_CO_PHASE_270           (3 << 8)
-#define   CLK_TX_PHASE_000           (0 << 10)
-#define   CLK_TX_PHASE_090           (1 << 10)
-#define   CLK_TX_PHASE_180           (2 << 10)
-#define   CLK_TX_PHASE_270           (3 << 10)
+#define        UPDATE(x, h, l)               (((x) << (l)) & GENMASK((h), (l)))

A macro already exists for that: FIELD_PREP(), please use it with proper BIT and GENMASK defines.

Thanks for this input.

Quoted 52 lines
Quoted 39 lines
arch/arm/include/asm/arch-meson/sd_emmc.h +1 -0
+
 #define   CLK_ALWAYS_ON                      BIT(24)
 
 #define MESON_SD_EMMC_CFG            0x44
drivers/mmc/meson_gx_mmc.c +21 -6
index 86c1a7164a..67b1b075ab 100644
@@ -51,12 +51,38 @@ static void meson_mmc_config_clock(struct mmc *mmc)
      }
      clk_div = DIV_ROUND_UP(clk, mmc->clock);
 
-     /* 180 phase core clock */
-     meson_mmc_clk |= CLK_CO_PHASE_180;
-
-     /* 180 phase tx clock */
-     meson_mmc_clk |= CLK_TX_PHASE_000;
-
+     /* Clock divider */
+     meson_mmc_clk = GENMASK(5, 0);
+     /* Clock source 1: Fix PLL, 1000MHz */
+     meson_mmc_clk |= UPDATE(1, 7, 6);
+     /* Core clock phase 2:180 */
+     meson_mmc_clk |= UPDATE(2, 9, 8);
+     /* TX clock phase 2:180 */
+     meson_mmc_clk |= UPDATE(2, 11, 10);
+     /* RX clock phase 0:180 */
+     meson_mmc_clk |= UPDATE(0, 13, 12);
+#ifdef CONFIG_MESON_GX
+     /* TX clock delay line */
+     meson_mmc_clk |= GENMASK(19, 16);
+     /* RX clock delay line */
+     meson_mmc_clk |= GENMASK(23, 20);
+     /* clk always on */
+     meson_mmc_clk |= BIT(20);
+     /* clk irq sdio sleep */
+     meson_mmc_clk |= BIT(25);
+#endif
+#if (defined(CONFIG_MESON_AXG) || defined(CONFIG_MESON_G12A))

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 84

Quoted 10 lines
drivers/mmc/meson_gx_mmc.c +10 -0
+     /* TX clock delay line */
+     meson_mmc_clk |=  GENMASK(21, 16);
+     /* RX clock delay line */
+     meson_mmc_clk |=  GENMASK(27, 22);
+     /* clk always on */
+     meson_mmc_clk |= BIT(28);
+     /* clk irq sdio sleep */
+     meson_mmc_clk |= BIT(29);
+     /* clk irq sdio sleep_ds */
+     meson_mmc_clk |= BIT(30);

As Jaehoon wrote, please define these MASKs and BITs

Quoted 8 lines

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 85

Quoted 1 line
drivers/mmc/meson_gx_mmc.c +1 -0
+#endif

Instead of ifdef, please add a data in the compatible list and use thez fact we use amlogic,meson-axg-mmc on AXG & G12/SM1.

Example: https://github.com/u-boot/u-boot/blob/master/drivers/video/meson/meson_vpu.c#L98
and https://github.com/u-boot/u-boot/blob/master/drivers/video/meson/meson_vpu.c#L37

Ok, Thanks for the input.

Quoted 7 lines

drivers/mmc/meson_gx_mmc.c static void meson_mmc_config_clock(struct mmc *mmc) · line 88

Quoted 4 lines
drivers/mmc/meson_gx_mmc.c +0 -0
      /* clock settings */
      meson_mmc_clk |= clk_src;
      meson_mmc_clk |= clk_div;

Thanks,
Neil

-Anand

author
#6 lore raw

PATCH v4 2/3 arm: dts: Add mmc alias to avoid warning

In reply to Anand Moon

Add missing mmc alias to dts nodes to avoid
below debug warning.

mmc_bind: alias ret=-2, devnum=-1
mmc_bind: alias ret=-2, devnum=-1

---
 arch/arm/dts/meson-axg-s400.dts               | 2 ++
 arch/arm/dts/meson-g12a-sei510.dts            | 3 +++
 arch/arm/dts/meson-g12a-u200.dts              | 3 +++
 arch/arm/dts/meson-g12b-odroid-n2.dts         | 3 +++
 arch/arm/dts/meson-gxbb-odroidc2.dts          | 3 +++
 arch/arm/dts/meson-gxbb-p20x.dtsi             | 3 +++
 arch/arm/dts/meson-gxl-s805x-libretech-ac.dts | 3 +++
 arch/arm/dts/meson-gxl-s905x-p212.dtsi        | 3 +++
 arch/arm/dts/meson-gxm-khadas-vim2.dts        | 3 +++
 arch/arm/dts/meson-sm1-sei610.dts             | 3 +++
 10 files changed, 29 insertions(+)
arch/arm/dts/meson-axg-s400.dts +2 -0
index 18778ada7b..b0192a9720 100644
@@ -58,6 +58,8 @@
 	aliases {
 		serial0 = &uart_AO;
 		serial1 = &uart_A;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	linein: audio-codec at 0 {
arch/arm/dts/meson-g12a-sei510.dts +3 -0
index c7a8736885..0e6378a320 100644
@@ -31,6 +31,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	mono_dac: audio-codec-0 {
arch/arm/dts/meson-g12a-u200.dts +3 -0
index 8551fbd4a4..88b4d365f8 100644
@@ -16,6 +16,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-g12b-odroid-n2.dts +3 -0
index 42f1540575..888429b1cc 100644
@@ -18,6 +18,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxbb-odroidc2.dts +3 -0
index 54954b314a..1436002013 100644
@@ -17,6 +17,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxbb-p20x.dtsi +3 -0
index 0be0f2a5d2..d55f5e1abb 100644
@@ -11,6 +11,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxl-s805x-libretech-ac.dts +3 -0
index 82b1c48511..6422e11e5e 100644
@@ -20,6 +20,9 @@
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
 		spi0 = &spifc;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxl-s905x-p212.dtsi +3 -0
index a1b31013ab..d712e9fa1d 100644
@@ -17,6 +17,9 @@
 		serial0 = &uart_AO;
 		serial1 = &uart_A;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxm-khadas-vim2.dts +3 -0
index 782e9edac8..723061f0e2 100644
@@ -20,6 +20,9 @@
 		serial0 = &uart_AO;
 		serial1 = &uart_A;
 		serial2 = &uart_AO_B;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-sm1-sei610.dts +3 -0
index 3435aaa4e8..3aafc20ccd 100644
@@ -17,6 +17,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
Signature · 1 line
2.25.0
#7 lore raw

PATCH v4 2/3 arm: dts: Add mmc alias to avoid warning

Hi,

Quoted 151 lines · Anand Moon

Add missing mmc alias to dts nodes to avoid
below debug warning.

mmc_bind: alias ret=-2, devnum=-1
mmc_bind: alias ret=-2, devnum=-1

---
 arch/arm/dts/meson-axg-s400.dts               | 2 ++
 arch/arm/dts/meson-g12a-sei510.dts            | 3 +++
 arch/arm/dts/meson-g12a-u200.dts              | 3 +++
 arch/arm/dts/meson-g12b-odroid-n2.dts         | 3 +++
 arch/arm/dts/meson-gxbb-odroidc2.dts          | 3 +++
 arch/arm/dts/meson-gxbb-p20x.dtsi             | 3 +++
 arch/arm/dts/meson-gxl-s805x-libretech-ac.dts | 3 +++
 arch/arm/dts/meson-gxl-s905x-p212.dtsi        | 3 +++
 arch/arm/dts/meson-gxm-khadas-vim2.dts        | 3 +++
 arch/arm/dts/meson-sm1-sei610.dts             | 3 +++
 10 files changed, 29 insertions(+)
arch/arm/dts/meson-axg-s400.dts +2 -0
index 18778ada7b..b0192a9720 100644
@@ -58,6 +58,8 @@
 	aliases {
 		serial0 = &uart_AO;
 		serial1 = &uart_A;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	linein: audio-codec at 0 {
arch/arm/dts/meson-g12a-sei510.dts +3 -0
index c7a8736885..0e6378a320 100644
@@ -31,6 +31,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	mono_dac: audio-codec-0 {
arch/arm/dts/meson-g12a-u200.dts +3 -0
index 8551fbd4a4..88b4d365f8 100644
@@ -16,6 +16,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-g12b-odroid-n2.dts +3 -0
index 42f1540575..888429b1cc 100644
@@ -18,6 +18,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxbb-odroidc2.dts +3 -0
index 54954b314a..1436002013 100644
@@ -17,6 +17,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxbb-p20x.dtsi +3 -0
index 0be0f2a5d2..d55f5e1abb 100644
@@ -11,6 +11,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxl-s805x-libretech-ac.dts +3 -0
index 82b1c48511..6422e11e5e 100644
@@ -20,6 +20,9 @@
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
 		spi0 = &spifc;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxl-s905x-p212.dtsi +3 -0
index a1b31013ab..d712e9fa1d 100644
@@ -17,6 +17,9 @@
 		serial0 = &uart_AO;
 		serial1 = &uart_A;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-gxm-khadas-vim2.dts +3 -0
index 782e9edac8..723061f0e2 100644
@@ -20,6 +20,9 @@
 		serial0 = &uart_AO;
 		serial1 = &uart_A;
 		serial2 = &uart_AO_B;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {
arch/arm/dts/meson-sm1-sei610.dts +0 -0
index 3435aaa4e8..3aafc20ccd 100644

arch/arm/dts/meson-sm1-sei610.dts line 25

Quoted 9 lines
arch/arm/dts/meson-sm1-sei610.dts +3 -0
@@ -17,6 +17,9 @@
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_a;
+		mmc1 = &sd_emmc_b;
+		mmc2 = &sd_emmc_c;
 	};
 
 	chosen {

Since it's not a linux binding but u-boot specific, please move these to the -u-boot.dtsi instead

Neil

author
#8 lore raw

PATCH v4 2/3 arm: dts: Add mmc alias to avoid warning

Hi Neil,

Quoted 163 lines · Neil Armstrong

Hi,

Quoted 158 lines · Anand Moon

Add missing mmc alias to dts nodes to avoid
below debug warning.

mmc_bind: alias ret=-2, devnum=-1
mmc_bind: alias ret=-2, devnum=-1

---
 arch/arm/dts/meson-axg-s400.dts               | 2 ++
 arch/arm/dts/meson-g12a-sei510.dts            | 3 +++
 arch/arm/dts/meson-g12a-u200.dts              | 3 +++
 arch/arm/dts/meson-g12b-odroid-n2.dts         | 3 +++
 arch/arm/dts/meson-gxbb-odroidc2.dts          | 3 +++
 arch/arm/dts/meson-gxbb-p20x.dtsi             | 3 +++
 arch/arm/dts/meson-gxl-s805x-libretech-ac.dts | 3 +++
 arch/arm/dts/meson-gxl-s905x-p212.dtsi        | 3 +++
 arch/arm/dts/meson-gxm-khadas-vim2.dts        | 3 +++
 arch/arm/dts/meson-sm1-sei610.dts             | 3 +++
 10 files changed, 29 insertions(+)
arch/arm/dts/meson-axg-s400.dts +2 -0
index 18778ada7b..b0192a9720 100644
@@ -58,6 +58,8 @@
      aliases {
              serial0 = &uart_AO;
              serial1 = &uart_A;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
      linein: audio-codec at 0 {
arch/arm/dts/meson-g12a-sei510.dts +3 -0
index c7a8736885..0e6378a320 100644
@@ -31,6 +31,9 @@
      aliases {
              serial0 = &uart_AO;
              ethernet0 = &ethmac;
+             mmc0 = &sd_emmc_a;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
      mono_dac: audio-codec-0 {
arch/arm/dts/meson-g12a-u200.dts +3 -0
index 8551fbd4a4..88b4d365f8 100644
@@ -16,6 +16,9 @@
      aliases {
              serial0 = &uart_AO;
              ethernet0 = &ethmac;
+             mmc0 = &sd_emmc_a;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
      chosen {
arch/arm/dts/meson-g12b-odroid-n2.dts +3 -0
index 42f1540575..888429b1cc 100644
@@ -18,6 +18,9 @@
      aliases {
              serial0 = &uart_AO;
              ethernet0 = &ethmac;
+             mmc0 = &sd_emmc_a;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
      chosen {
arch/arm/dts/meson-gxbb-odroidc2.dts +3 -0
index 54954b314a..1436002013 100644
@@ -17,6 +17,9 @@
      aliases {
              serial0 = &uart_AO;
              ethernet0 = &ethmac;
+             mmc0 = &sd_emmc_a;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
      chosen {
arch/arm/dts/meson-gxbb-p20x.dtsi +3 -0
index 0be0f2a5d2..d55f5e1abb 100644
@@ -11,6 +11,9 @@
      aliases {
              serial0 = &uart_AO;
              ethernet0 = &ethmac;
+             mmc0 = &sd_emmc_a;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
      chosen {
arch/arm/dts/meson-gxl-s805x-libretech-ac.dts +3 -0
index 82b1c48511..6422e11e5e 100644
@@ -20,6 +20,9 @@
              serial0 = &uart_AO;
              ethernet0 = &ethmac;
              spi0 = &spifc;
+             mmc0 = &sd_emmc_a;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
      chosen {
arch/arm/dts/meson-gxl-s905x-p212.dtsi +3 -0
index a1b31013ab..d712e9fa1d 100644
@@ -17,6 +17,9 @@
              serial0 = &uart_AO;
              serial1 = &uart_A;
              ethernet0 = &ethmac;
+             mmc0 = &sd_emmc_a;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
      chosen {
arch/arm/dts/meson-gxm-khadas-vim2.dts +3 -0
index 782e9edac8..723061f0e2 100644
@@ -20,6 +20,9 @@
              serial0 = &uart_AO;
              serial1 = &uart_A;
              serial2 = &uart_AO_B;
+             mmc0 = &sd_emmc_a;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
      chosen {
arch/arm/dts/meson-sm1-sei610.dts +3 -0
index 3435aaa4e8..3aafc20ccd 100644
@@ -17,6 +17,9 @@
      aliases {
              serial0 = &uart_AO;
              ethernet0 = &ethmac;
+             mmc0 = &sd_emmc_a;
+             mmc1 = &sd_emmc_b;
+             mmc2 = &sd_emmc_c;
      };
 
Quoted 6 lines

arch/arm/dts/meson-sm1-sei610.dts line 25

Quoted 2 lines
arch/arm/dts/meson-sm1-sei610.dts +0 -0
      chosen {

Since it's not a linux binding but u-boot specific, please move these to the -u-boot.dtsi instead

Neil

Thanks for your review.

Ok I will move all the aliase to common meson-gx-u-boot.dtsi file..

-Anand

author
#9 lore raw

PATCH v4 3/3 arm: dts: Add cd-gpio for eMMC

In reply to Anand Moon

Add cd-gpio property for eMMC node.

---
New patch in this series

---
 arch/arm/dts/meson-g12b-odroid-n2.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/meson-g12b-odroid-n2.dts +1 -0
index 888429b1cc..23ec14abe7 100644
@@ -449,6 +449,7 @@
 	max-frequency = <200000000>;
 	disable-wp;
 
+	cd-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>; /* eMMC_nDET */
 	mmc-pwrseq = <&emmc_pwrseq>;
 	vmmc-supply = <&vcc_3v3>;
 	vqmmc-supply = <&flash_1v8>;
Signature · 1 line
2.25.0
#10 lore raw

PATCH v4 3/3 arm: dts: Add cd-gpio for eMMC

Hi,

Quoted 15 lines · Anand Moon

Add cd-gpio property for eMMC node.

---
New patch in this series

---
 arch/arm/dts/meson-g12b-odroid-n2.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/meson-g12b-odroid-n2.dts +0 -0
index 888429b1cc..23ec14abe7 100644

arch/arm/dts/meson-g12b-odroid-n2.dts line 455

Quoted 7 lines
arch/arm/dts/meson-g12b-odroid-n2.dts +1 -0
@@ -449,6 +449,7 @@
 	max-frequency = <200000000>;
 	disable-wp;
 
+	cd-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>; /* eMMC_nDET */
 	mmc-pwrseq = <&emmc_pwrseq>;
 	vmmc-supply = <&vcc_3v3>;
 	vqmmc-supply = <&flash_1v8>;

If it's missing, submit it to linux-amlogic and move it to the -u-boot.dtsi file.

Neil

author
#11 lore raw

PATCH v4 3/3 arm: dts: Add cd-gpio for eMMC

Hi Neil,

Quoted 29 lines · Neil Armstrong

Hi,

Quoted 15 lines · Anand Moon

Add cd-gpio property for eMMC node.

---
New patch in this series

---
 arch/arm/dts/meson-g12b-odroid-n2.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/dts/meson-g12b-odroid-n2.dts +0 -0
index 888429b1cc..23ec14abe7 100644

arch/arm/dts/meson-g12b-odroid-n2.dts line 455

Quoted 7 lines
arch/arm/dts/meson-g12b-odroid-n2.dts +1 -0
@@ -449,6 +449,7 @@
      max-frequency = <200000000>;
      disable-wp;
 
+     cd-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>; /* eMMC_nDET */
      mmc-pwrseq = <&emmc_pwrseq>;
      vmmc-supply = <&vcc_3v3>;
      vqmmc-supply = <&flash_1v8>;

If it's missing, submit it to linux-amlogic and move it to the -u-boot.dtsi file.

Quoted 1 line

Neil

Thanks for your review.
Ok I will submit this patch to linux-amlogic

-Anand