Skip to contentSkip to conversation

arm: mvebu: Espressobin: Fix setting $fdtfile env

PATCH In review Pali Rohár 4 participants 10 messages Jul 14, 2021 – Jul 15, 2021 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 arm: mvebu: Espressobin: Fix setting $fdtfile env

Ensure that 'env default -a' always set correct value to $fdtfile, even when custom user variable is already stored in non-volatile env storage (means that env_get("fdtfile") call returns non-NULL value).

As default value is now correctly set like if specified at compile time in CONFIG_EXTRA_ENV_SETTINGS, there is no need to set $fdtfile explicitly via env_set("fdtfile", ...) call.

So remove wrong skip based on env_get("fdtfile") and then also unneeded env_set("fdtfile", ...) call.

Fixes c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for $fdtfile env variable")
---
 board/Marvell/mvebu_armada-37xx/board.c | 7 -------
 1 file changed, 7 deletions(-)
board/Marvell/mvebu_armada-37xx/board.c +0 -7
index 6a0e2fc3cd8f..53408d37af9b 100644
@@ -133,9 +133,6 @@ int board_late_init(void)
 		device_unbind(dev);
 	}
 
-	if (env_get("fdtfile"))
-		return 0;
-
 	/* Ensure that 'env default -a' set correct value to $fdtfile */
 	if (ddr4 && emmc)
 		strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin-v7-emmc.dtb");
@@ -146,10 +143,6 @@ int board_late_init(void)
 	else
 		strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin.dtb");
 
-	/* If $fdtfile was not set explicitly by user then set default value */
-	if (!env_get("fdtfile"))
-		env_set("fdtfile", ptr + sizeof("fdtfile="));
-
 	return 0;
 }
 #endif
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/3 arm: mvebu: Espressobin: Use function mmc_get_op_cond() for detecting eMMC

Use function mmc_get_op_cond() instead of mmc_init() for detecting presence of eMMC. Documentation for this function says that it could be used to detect the presence of SD/eMMC when no card detect logic is available.

This function is also used by mx6cuboxi board for detecting presence of eMMC.

---
 board/Marvell/mvebu_armada-37xx/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/Marvell/mvebu_armada-37xx/board.c +1 -1
index 53408d37af9b..6086996b8062 100644
@@ -124,7 +124,7 @@ int board_late_init(void)
 
 	/* eMMC is mmc dev num 1 */
 	mmc_dev = find_mmc_device(1);
-	emmc = (mmc_dev && mmc_init(mmc_dev) == 0);
+	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
 
 	/* if eMMC is not present then remove it from DM */
 	if (!emmc && mmc_dev) {
Signature · 1 line
2.20.1
Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] arm: mvebu: Espressobin: Use function mmc_get_op_cond() for detecting eMMC

Quoted 7 lines · Pali Rohár

Use function mmc_get_op_cond() instead of mmc_init() for detecting presence of eMMC. Documentation for this function says that it could be used to detect the presence of SD/eMMC when no card detect logic is available.

This function is also used by mx6cuboxi board for detecting presence of eMMC.

Thanks,
Stefan

Quoted 10 lines
---
  board/Marvell/mvebu_armada-37xx/board.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/Marvell/mvebu_armada-37xx/board.c +0 -0
index 53408d37af9b..6086996b8062 100644

board/Marvell/mvebu_armada-37xx/board.c int board_late_init(void) · line 130

Quoted 8 lines
board/Marvell/mvebu_armada-37xx/board.c +1 -1
@@ -124,7 +124,7 @@ int board_late_init(void)
 
  	/* eMMC is mmc dev num 1 */
  	mmc_dev = find_mmc_device(1);
-	emmc = (mmc_dev && mmc_init(mmc_dev) == 0);
+	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
 
  	/* if eMMC is not present then remove it from DM */
  	if (!emmc && mmc_dev) {

Viele Grüße,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#3 lore raw

PATCH 3/3 mmc: mmc_get_op_cond: Allow quiet detection of eMMC

In reply to Pali Rohár

Add a new 'quiet' argument to mmc_get_op_cond() function which avoids printing error message when SD/eMMC card is not detected.

Espressobin and mx6cuboxi boards use this function for detecting presence of eMMC and therefore it is expected and normal that eMMC does not have to be connected. So error message "Card did not respond to voltage select!" should be skipped in this case as it is not an error.

---
 board/Marvell/mvebu_armada-37xx/board.c | 2 +-
 board/solidrun/mx6cuboxi/mx6cuboxi.c    | 2 +-
 drivers/mmc/mmc.c                       | 7 ++++---
 include/mmc.h                           | 3 ++-
 4 files changed, 8 insertions(+), 6 deletions(-)
board/Marvell/mvebu_armada-37xx/board.c +1 -1
index 6086996b8062..fdc873b1952f 100644
@@ -124,7 +124,7 @@ int board_late_init(void)
 
 	/* eMMC is mmc dev num 1 */
 	mmc_dev = find_mmc_device(1);
-	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
+	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev, true) == 0);
 
 	/* if eMMC is not present then remove it from DM */
 	if (!emmc && mmc_dev) {
board/solidrun/mx6cuboxi/mx6cuboxi.c +1 -1
index 3eadc38f6fd4..6207bf8253ab 100644
@@ -374,7 +374,7 @@ static bool has_emmc(void)
 	mmc = find_mmc_device(2);
 	if (!mmc)
 		return 0;
-	return (mmc_get_op_cond(mmc) < 0) ? 0 : 1;
+	return (mmc_get_op_cond(mmc, true) < 0) ? 0 : 1;
 }
 
 int checkboard(void)
drivers/mmc/mmc.c +4 -3
index 1e83007286b2..8078a89f18cb 100644
@@ -2766,7 +2766,7 @@ static int mmc_power_cycle(struct mmc *mmc)
 	return mmc_power_on(mmc);
 }
 
-int mmc_get_op_cond(struct mmc *mmc)
+int mmc_get_op_cond(struct mmc *mmc, bool quiet)
 {
 	bool uhs_en = supports_uhs(mmc->cfg->host_caps);
 	int err;
@@ -2842,7 +2842,8 @@ retry:
 
 		if (err) {
 #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
-			pr_err("Card did not respond to voltage select! : %d\n", err);
+			if (!quiet)
+				pr_err("Card did not respond to voltage select! : %d\n", err);
 #endif
 			return -EOPNOTSUPP;
 		}
@@ -2882,7 +2883,7 @@ int mmc_start_init(struct mmc *mmc)
 		return -ENOMEDIUM;
 	}
 
-	err = mmc_get_op_cond(mmc);
+	err = mmc_get_op_cond(mmc, false);
 
 	if (!err)
 		mmc->init_in_progress = 1;
include/mmc.h +2 -1
index 6f943e78b740..0bf19de20e52 100644
@@ -900,9 +900,10 @@ int mmc_set_bkops_enable(struct mmc *mmc);
  * the presence of SD/eMMC when no card detect logic is available.
  *
  * @param mmc	Pointer to a MMC device struct
+ * @param quiet	Be quiet, do not print error messages when card is not detected.
  * @return 0 on success, <0 on error.
  */
-int mmc_get_op_cond(struct mmc *mmc);
+int mmc_get_op_cond(struct mmc *mmc, bool quiet);
 
 /**
  * Start device initialization and return immediately; it does not block on
Signature · 1 line
2.20.1
#4 lore raw

Re: [PATCH 3/3] mmc: mmc_get_op_cond: Allow quiet detection of eMMC

Hi Pali,

Quoted 11 lines · Pali Rohár

Add a new 'quiet' argument to mmc_get_op_cond() function which avoids printing error message when SD/eMMC card is not detected.

Espressobin and mx6cuboxi boards use this function for detecting presence of eMMC and therefore it is expected and normal that eMMC does not have to be connected. So error message "Card did not respond to voltage select!" should be skipped in this case as it is not an error.

---
 board/Marvell/mvebu_armada-37xx/board.c | 2 +-

Ordering this patch before #2 would make it smaller.

baruch

Quoted 79 lines
 board/solidrun/mx6cuboxi/mx6cuboxi.c    | 2 +-
 drivers/mmc/mmc.c                       | 7 ++++---
 include/mmc.h                           | 3 ++-
 4 files changed, 8 insertions(+), 6 deletions(-)
board/Marvell/mvebu_armada-37xx/board.c +1 -1
index 6086996b8062..fdc873b1952f 100644
@@ -124,7 +124,7 @@ int board_late_init(void)
 
 	/* eMMC is mmc dev num 1 */
 	mmc_dev = find_mmc_device(1);
-	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
+	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev, true) == 0);
 
 	/* if eMMC is not present then remove it from DM */
 	if (!emmc && mmc_dev) {
board/solidrun/mx6cuboxi/mx6cuboxi.c +1 -1
index 3eadc38f6fd4..6207bf8253ab 100644
@@ -374,7 +374,7 @@ static bool has_emmc(void)
 	mmc = find_mmc_device(2);
 	if (!mmc)
 		return 0;
-	return (mmc_get_op_cond(mmc) < 0) ? 0 : 1;
+	return (mmc_get_op_cond(mmc, true) < 0) ? 0 : 1;
 }
 
 int checkboard(void)
drivers/mmc/mmc.c +4 -3
index 1e83007286b2..8078a89f18cb 100644
@@ -2766,7 +2766,7 @@ static int mmc_power_cycle(struct mmc *mmc)
 	return mmc_power_on(mmc);
 }
 
-int mmc_get_op_cond(struct mmc *mmc)
+int mmc_get_op_cond(struct mmc *mmc, bool quiet)
 {
 	bool uhs_en = supports_uhs(mmc->cfg->host_caps);
 	int err;
@@ -2842,7 +2842,8 @@ retry:
 
 		if (err) {
 #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
-			pr_err("Card did not respond to voltage select! : %d\n", err);
+			if (!quiet)
+				pr_err("Card did not respond to voltage select! : %d\n", err);
 #endif
 			return -EOPNOTSUPP;
 		}
@@ -2882,7 +2883,7 @@ int mmc_start_init(struct mmc *mmc)
 		return -ENOMEDIUM;
 	}
 
-	err = mmc_get_op_cond(mmc);
+	err = mmc_get_op_cond(mmc, false);
 
 	if (!err)
 		mmc->init_in_progress = 1;
include/mmc.h +2 -1
index 6f943e78b740..0bf19de20e52 100644
@@ -900,9 +900,10 @@ int mmc_set_bkops_enable(struct mmc *mmc);
  * the presence of SD/eMMC when no card detect logic is available.
  *
  * @param mmc	Pointer to a MMC device struct
+ * @param quiet	Be quiet, do not print error messages when card is not detected.
  * @return 0 on success, <0 on error.
  */
-int mmc_get_op_cond(struct mmc *mmc);
+int mmc_get_op_cond(struct mmc *mmc, bool quiet);
 
 /**
  * Start device initialization and return immediately; it does not block on
Signature · 3 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -
Reviewed-by on v1 3/3
#5 lore raw

Re: [PATCH 3/3] mmc: mmc_get_op_cond: Allow quiet detection of eMMC

In reply to Pali Rohár
Quoted 9 lines · Pali Rohár

Add a new 'quiet' argument to mmc_get_op_cond() function which avoids printing error message when SD/eMMC card is not detected.

Espressobin and mx6cuboxi boards use this function for detecting presence of eMMC and therefore it is expected and normal that eMMC does not have to be connected. So error message "Card did not respond to voltage select!" should be skipped in this case as it is not an error.

Thanks,
Stefan

Quoted 72 lines
---
  board/Marvell/mvebu_armada-37xx/board.c | 2 +-
  board/solidrun/mx6cuboxi/mx6cuboxi.c    | 2 +-
  drivers/mmc/mmc.c                       | 7 ++++---
  include/mmc.h                           | 3 ++-
  4 files changed, 8 insertions(+), 6 deletions(-)
board/Marvell/mvebu_armada-37xx/board.c +1 -1
index 6086996b8062..fdc873b1952f 100644
@@ -124,7 +124,7 @@ int board_late_init(void)
 
  	/* eMMC is mmc dev num 1 */
  	mmc_dev = find_mmc_device(1);
-	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
+	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev, true) == 0);
 
  	/* if eMMC is not present then remove it from DM */
  	if (!emmc && mmc_dev) {
board/solidrun/mx6cuboxi/mx6cuboxi.c +1 -1
index 3eadc38f6fd4..6207bf8253ab 100644
@@ -374,7 +374,7 @@ static bool has_emmc(void)
  	mmc = find_mmc_device(2);
  	if (!mmc)
  		return 0;
-	return (mmc_get_op_cond(mmc) < 0) ? 0 : 1;
+	return (mmc_get_op_cond(mmc, true) < 0) ? 0 : 1;
  }
 
  int checkboard(void)
drivers/mmc/mmc.c +4 -3
index 1e83007286b2..8078a89f18cb 100644
@@ -2766,7 +2766,7 @@ static int mmc_power_cycle(struct mmc *mmc)
  	return mmc_power_on(mmc);
  }
 
-int mmc_get_op_cond(struct mmc *mmc)
+int mmc_get_op_cond(struct mmc *mmc, bool quiet)
  {
  	bool uhs_en = supports_uhs(mmc->cfg->host_caps);
  	int err;
@@ -2842,7 +2842,8 @@ retry:
 
  		if (err) {
  #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
-			pr_err("Card did not respond to voltage select! : %d\n", err);
+			if (!quiet)
+				pr_err("Card did not respond to voltage select! : %d\n", err);
  #endif
  			return -EOPNOTSUPP;
  		}
@@ -2882,7 +2883,7 @@ int mmc_start_init(struct mmc *mmc)
  		return -ENOMEDIUM;
  	}
 
-	err = mmc_get_op_cond(mmc);
+	err = mmc_get_op_cond(mmc, false);
 
  	if (!err)
  		mmc->init_in_progress = 1;
include/mmc.h +0 -0
index 6f943e78b740..0bf19de20e52 100644
@@ -900,9 +900,10 @@ int mmc_set_bkops_enable(struct mmc *mmc);
   * the presence of SD/eMMC when no card detect logic is available.

include/mmc.h int mmc_set_bkops_enable(struct mmc *mmc); · line 909

Quoted 10 lines
include/mmc.h +2 -1
   *
   * @param mmc	Pointer to a MMC device struct
+ * @param quiet	Be quiet, do not print error messages when card is not detected.
   * @return 0 on success, <0 on error.
   */
-int mmc_get_op_cond(struct mmc *mmc);
+int mmc_get_op_cond(struct mmc *mmc, bool quiet);
 
  /**
   * Start device initialization and return immediately; it does not block on

Viele Grüße,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#6 lore raw

Re: [PATCH 3/3] mmc: mmc_get_op_cond: Allow quiet detection of eMMC

(added Jaehoon as MMC co-maintainer)

Quoted 4 lines · Stefan Roese
Quoted 3 lines · Pali Rohár

Add a new 'quiet' argument to mmc_get_op_cond() function which avoids printing error message when SD/eMMC card is not detected.

Quoted 8 lines
Quoted 6 lines

Espressobin and mx6cuboxi boards use this function for detecting presence of eMMC and therefore it is expected and normal that eMMC does not have to be connected. So error message "Card did not respond to voltage select!" should be skipped in this case as it is not an error.

Peng, Jaehoon are you okay with this patch? If yes, is it okay that I will pull it via the marvell tree?

Thanks,
Stefan

Quoted 76 lines

Thanks,
Stefan

Quoted 73 lines

---
  board/Marvell/mvebu_armada-37xx/board.c | 2 +- board/solidrun/mx6cuboxi/mx6cuboxi.c    | 2 +- drivers/mmc/mmc.c                       | 7 ++++--- include/mmc.h                           | 3 ++-

  4 files changed, 8 insertions(+), 6 deletions(-)
board/Marvell/mvebu_armada-37xx/board.c +1 -1
index 6086996b8062..fdc873b1952f 100644
@@ -124,7 +124,7 @@ int board_late_init(void)
       /* eMMC is mmc dev num 1 */
       mmc_dev = find_mmc_device(1);
-    emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
+    emmc = (mmc_dev && mmc_get_op_cond(mmc_dev, true) == 0);
       /* if eMMC is not present then remove it from DM */
       if (!emmc && mmc_dev) {
board/solidrun/mx6cuboxi/mx6cuboxi.c +1 -1
index 3eadc38f6fd4..6207bf8253ab 100644
@@ -374,7 +374,7 @@ static bool has_emmc(void)
       mmc = find_mmc_device(2);
       if (!mmc)
           return 0;
-    return (mmc_get_op_cond(mmc) < 0) ? 0 : 1;
+    return (mmc_get_op_cond(mmc, true) < 0) ? 0 : 1;
   }
   int checkboard(void)
drivers/mmc/mmc.c +3 -2
index 1e83007286b2..8078a89f18cb 100644
@@ -2766,7 +2766,7 @@ static int mmc_power_cycle(struct mmc *mmc)
       return mmc_power_on(mmc);
   }
-int mmc_get_op_cond(struct mmc *mmc)
+int mmc_get_op_cond(struct mmc *mmc, bool quiet)
   {
       bool uhs_en = supports_uhs(mmc->cfg->host_caps);
       int err;
@@ -2842,7 +2842,8 @@ retry:
           if (err) {
   #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
-            pr_err("Card did not respond to voltage select! : %d\n", 
 err);
+            if (!quiet)
+                pr_err("Card did not respond to voltage select! : 
 %d\n", err);
   #endif
               return -EOPNOTSUPP;

          }

drivers/mmc/mmc.c +1 -1
@@ -2882,7 +2883,7 @@ int mmc_start_init(struct mmc *mmc)
           return -ENOMEDIUM;
       }
-    err = mmc_get_op_cond(mmc);
+    err = mmc_get_op_cond(mmc, false);
       if (!err)
           mmc->init_in_progress = 1;
include/mmc.h +1 -0
index 6f943e78b740..0bf19de20e52 100644
@@ -900,9 +900,10 @@ int mmc_set_bkops_enable(struct mmc *mmc);
    * the presence of SD/eMMC when no card detect logic is available.
    *
    * @param mmc    Pointer to a MMC device struct
+ * @param quiet    Be quiet, do not print error messages when card is 

not detected.
   * @return 0 on success, <0 on error.
   */
-int mmc_get_op_cond(struct mmc *mmc);

Quoted 9 lines
Quoted 4 lines

+int mmc_get_op_cond(struct mmc *mmc, bool quiet);
  /**
   * Start device initialization and return immediately; it does not block on

Viele Grüße,
Stefan

Viele Grüße,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Acked-by
#7 lore raw

Re: [PATCH 3/3] mmc: mmc_get_op_cond: Allow quiet detection of eMMC

Hi Stefan,

Quoted 12 lines · Stefan Roese

(added Jaehoon as MMC co-maintainer)

Quoted 9 lines · Stefan Roese
Quoted 8 lines · Pali Rohár

Add a new 'quiet' argument to mmc_get_op_cond() function which avoids printing error message when SD/eMMC card is not detected.

Espressobin and mx6cuboxi boards use this function for detecting presence of eMMC and therefore it is expected and normal that eMMC does not have to be connected. So error message "Card did not respond to voltage select!" should be skipped in this case as it is not an error.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Peng, Jaehoon are you okay with this patch? If yes, is it okay that I will pull it via the marvell tree?

I don't have any objection.

Best Regards,
Jaehoon Chung

Quoted 91 lines

Thanks,
Stefan

Quoted 73 lines

Thanks,
Stefan

Quoted 70 lines

---
  board/Marvell/mvebu_armada-37xx/board.c | 2 +- board/solidrun/mx6cuboxi/mx6cuboxi.c    | 2 +- drivers/mmc/mmc.c                       | 7 ++++--- include/mmc.h                           | 3 ++-

  4 files changed, 8 insertions(+), 6 deletions(-)
board/Marvell/mvebu_armada-37xx/board.c +1 -1
index 6086996b8062..fdc873b1952f 100644
@@ -124,7 +124,7 @@ int board_late_init(void)
       /* eMMC is mmc dev num 1 */
       mmc_dev = find_mmc_device(1);
-    emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
+    emmc = (mmc_dev && mmc_get_op_cond(mmc_dev, true) == 0);
       /* if eMMC is not present then remove it from DM */
       if (!emmc && mmc_dev) {
board/solidrun/mx6cuboxi/mx6cuboxi.c +1 -1
index 3eadc38f6fd4..6207bf8253ab 100644
@@ -374,7 +374,7 @@ static bool has_emmc(void)
       mmc = find_mmc_device(2);
       if (!mmc)
           return 0;
-    return (mmc_get_op_cond(mmc) < 0) ? 0 : 1;
+    return (mmc_get_op_cond(mmc, true) < 0) ? 0 : 1;
   }
   int checkboard(void)
drivers/mmc/mmc.c +4 -3
index 1e83007286b2..8078a89f18cb 100644
@@ -2766,7 +2766,7 @@ static int mmc_power_cycle(struct mmc *mmc)
       return mmc_power_on(mmc);
   }
-int mmc_get_op_cond(struct mmc *mmc)
+int mmc_get_op_cond(struct mmc *mmc, bool quiet)
   {
       bool uhs_en = supports_uhs(mmc->cfg->host_caps);
       int err;
@@ -2842,7 +2842,8 @@ retry:
           if (err) {
   #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
-            pr_err("Card did not respond to voltage select! : %d\n", err);
+            if (!quiet)
+                pr_err("Card did not respond to voltage select! : %d\n", err);
   #endif
               return -EOPNOTSUPP;
           }
@@ -2882,7 +2883,7 @@ int mmc_start_init(struct mmc *mmc)
           return -ENOMEDIUM;
       }
-    err = mmc_get_op_cond(mmc);
+    err = mmc_get_op_cond(mmc, false);
       if (!err)
           mmc->init_in_progress = 1;
include/mmc.h +1 -1
index 6f943e78b740..0bf19de20e52 100644
@@ -900,9 +900,10 @@ int mmc_set_bkops_enable(struct mmc *mmc);
    * the presence of SD/eMMC when no card detect logic is available.
    *
    * @param mmc    Pointer to a MMC device struct
+ * @param quiet    Be quiet, do not print error messages when card is not detected.
    * @return 0 on success, <0 on error.
    */
-int mmc_get_op_cond(struct mmc *mmc);
Quoted 9 lines

include/mmc.h int mmc_set_bkops_enable(struct mmc *mmc);

Quoted 4 lines
include/mmc.h +1 -0
+int mmc_get_op_cond(struct mmc *mmc, bool quiet);
   /**
    * Start device initialization and return immediately; it does not block on
 

Viele Grüße,
Stefan

Viele Grüße,
Stefan

Reviewed-by on v1 1/3
#8 lore raw
In reply to Pali Rohár
Quoted 8 lines · Pali Rohár

Ensure that 'env default -a' always set correct value to $fdtfile, even when custom user variable is already stored in non-volatile env storage (means that env_get("fdtfile") call returns non-NULL value).

As default value is now correctly set like if specified at compile time in CONFIG_EXTRA_ENV_SETTINGS, there is no need to set $fdtfile explicitly via env_set("fdtfile", ...) call.

Quoted 5 lines

So remove wrong skip based on env_get("fdtfile") and then also unneeded env_set("fdtfile", ...) call.

Fixes c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for $fdtfile env variable")

Thanks,
Stefan

Quoted 20 lines
---
  board/Marvell/mvebu_armada-37xx/board.c | 7 -------
  1 file changed, 7 deletions(-)
board/Marvell/mvebu_armada-37xx/board.c +0 -3
index 6a0e2fc3cd8f..53408d37af9b 100644
@@ -133,9 +133,6 @@ int board_late_init(void)
  		device_unbind(dev);
  	}
 
-	if (env_get("fdtfile"))
-		return 0;
-
  	/* Ensure that 'env default -a' set correct value to $fdtfile */
  	if (ddr4 && emmc)
  		strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin-v7-emmc.dtb");

board/Marvell/mvebu_armada-37xx/board.c int board_late_init(void) · line 148

Quoted 10 lines
board/Marvell/mvebu_armada-37xx/board.c +0 -4
@@ -146,10 +143,6 @@ int board_late_init(void)
  	else
  		strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin.dtb");
 
-	/* If $fdtfile was not set explicitly by user then set default value */
-	if (!env_get("fdtfile"))
-		env_set("fdtfile", ptr + sizeof("fdtfile="));
-
  	return 0;
  }
  #endif

Viele Grüße,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#9 lore raw
In reply to Pali Rohár
Quoted 8 lines · Pali Rohár

Ensure that 'env default -a' always set correct value to $fdtfile, even when custom user variable is already stored in non-volatile env storage (means that env_get("fdtfile") call returns non-NULL value).

As default value is now correctly set like if specified at compile time in CONFIG_EXTRA_ENV_SETTINGS, there is no need to set $fdtfile explicitly via env_set("fdtfile", ...) call.

Quoted 5 lines

So remove wrong skip based on env_get("fdtfile") and then also unneeded env_set("fdtfile", ...) call.

Fixes c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for $fdtfile env variable")

All patches:

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 20 lines
---
  board/Marvell/mvebu_armada-37xx/board.c | 7 -------
  1 file changed, 7 deletions(-)
board/Marvell/mvebu_armada-37xx/board.c +0 -3
index 6a0e2fc3cd8f..53408d37af9b 100644
@@ -133,9 +133,6 @@ int board_late_init(void)
  		device_unbind(dev);
  	}
 
-	if (env_get("fdtfile"))
-		return 0;
-
  	/* Ensure that 'env default -a' set correct value to $fdtfile */
  	if (ddr4 && emmc)
  		strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin-v7-emmc.dtb");

board/Marvell/mvebu_armada-37xx/board.c int board_late_init(void) · line 148

Quoted 10 lines
board/Marvell/mvebu_armada-37xx/board.c +0 -4
@@ -146,10 +143,6 @@ int board_late_init(void)
  	else
  		strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin.dtb");
 
-	/* If $fdtfile was not set explicitly by user then set default value */
-	if (!env_get("fdtfile"))
-		env_set("fdtfile", ptr + sizeof("fdtfile="));
-
  	return 0;
  }
  #endif

Viele Grüße,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]