Skip to contentSkip to conversation

spl: mmc: Resolve emmc not load image after switched hw partition

PATCH In review Kuan Lim Lee 4 participants 8 messages Oct 3, 2023 – Oct 31, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: mmc: Resolve emmc not load image after switched hw partition

When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not load U-boot proper image after switched hardware partition.

---
 common/spl/spl_mmc.c | 3 +++
 1 file changed, 3 insertions(+)
common/spl/spl_mmc.c +3 -0
index 20f687e138..dc8a45222b 100644
@@ -447,6 +447,9 @@ int spl_mmc_load(struct spl_image_info *spl_image,
 #endif
 			return err;
 		}
+		err = mmc_load_image_raw_sector(spl_image, bootdev, mmc, 0);
+		if (!err)
+			return err;
 		/* Fall through */
 	case MMCSD_MODE_RAW:
 		debug("spl: mmc boot mode: raw\n");
Signature · 1 line
2.34.1
#1 lore raw

Hi,

Is this patch considered as accepted?

Quoted 37 lines

-----Original Message-----
From: KuanLim.Lee <[email protected]>
Sent: Tuesday, October 3, 2023 12:17 PM
To: [email protected]
Cc: Cheehong Ang <[email protected]>; WeiLiang Lim <[email protected]>; KuanLim.Lee <[email protected]>
Subject: [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition

When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not load U-boot proper image after switched hardware partition.

---
 common/spl/spl_mmc.c | 3 +++
 1 file changed, 3 insertions(+)
common/spl/spl_mmc.c index renamed from common/spl/spl_mmc.c +0 -0

20f687e138..dc8a45222b 100644

common/spl/spl_mmc.c +3 -0
@@ -447,6 +447,9 @@ int spl_mmc_load(struct spl_image_info *spl_image,
 #endif
 			return err;
 		}
+		err = mmc_load_image_raw_sector(spl_image, bootdev, mmc,
 0);
+		if (!err)
+			return err;
 		/* Fall through */
 	case MMCSD_MODE_RAW:

debug("spl: mmc boot mode: raw\n");
--
2.34.1

#2 lore raw
In reply to Kuan Lim Lee

Hi maintainers,

Could anyone of you help to review the patch?

Quoted 37 lines

-----Original Message-----
From: KuanLim.Lee <[email protected]>
Sent: Tuesday, October 3, 2023 12:17 PM
To: [email protected]
Cc: Cheehong Ang <[email protected]>; WeiLiang Lim <[email protected]>; KuanLim.Lee <[email protected]>
Subject: [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition

When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not load U-boot proper image after switched hardware partition.

---
 common/spl/spl_mmc.c | 3 +++
 1 file changed, 3 insertions(+)
common/spl/spl_mmc.c index renamed from common/spl/spl_mmc.c +0 -0

20f687e138..dc8a45222b 100644

common/spl/spl_mmc.c +3 -0
@@ -447,6 +447,9 @@ int spl_mmc_load(struct spl_image_info *spl_image,
 #endif
 			return err;
 		}
+		err = mmc_load_image_raw_sector(spl_image, bootdev, mmc,
 0);
+		if (!err)
+			return err;
 		/* Fall through */
 	case MMCSD_MODE_RAW:

debug("spl: mmc boot mode: raw\n");
--
2.34.1

#3 lore raw

Hi,

Quoted 2 lines · On Tue, 17 Oct 2023 04:53:40 +0000 KuanLim.Lee wrote:

Could anyone of you help to review the patch?

Maybe you should expand the audience to include the people listed by ./scripts/get_maintainer.pl common/spl/spl_mmc.c

Lothar Waßmann

#4 lore raw
In reply to Kuan Lim Lee
Quoted 15 lines · Kuan Lim Lee

When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not load U-boot proper image after switched hardware partition.

---
  common/spl/spl_mmc.c | 3 +++
  1 file changed, 3 insertions(+)
common/spl/spl_mmc.c +0 -0
index 20f687e138..dc8a45222b 100644

common/spl/spl_mmc.c int spl_mmc_load(struct spl_image_info *spl_image, · line 455

Quoted 9 lines
common/spl/spl_mmc.c +3 -0
@@ -447,6 +447,9 @@ int spl_mmc_load(struct spl_image_info *spl_image,
  #endif
  			return err;
  		}
+		err = mmc_load_image_raw_sector(spl_image, bootdev, mmc, 0);
+		if (!err)
+			return err;
  		/* Fall through */
  	case MMCSD_MODE_RAW:
  		debug("spl: mmc boot mode: raw\n");

So why doesn't the mmc_load_image_raw_sector below (line 475 or so) work?

--Sean

#5 lore raw
Quoted 22 lines · Sean Anderson
Quoted 1 line · Kuan Lim Lee

When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not

load

Quoted 14 lines

U-boot proper image after switched hardware partition.

---
  common/spl/spl_mmc.c | 3 +++
  1 file changed, 3 insertions(+)
common/spl/spl_mmc.c index renamed from common/spl/spl_mmc.c +0 -0

20f687e138..dc8a45222b 100644

common/spl/spl_mmc.c int spl_mmc_load(struct spl_image_info *spl_image, · line 450

Quoted 4 lines
common/spl/spl_mmc.c +1 -0
@@ -447,6 +447,9 @@ int spl_mmc_load(struct spl_image_info *spl_image,
  #endif
  			return err;
  		}
+		err = mmc_load_image_raw_sector(spl_image, bootdev, mmc,

0);

Quoted 7 lines

common/spl/spl_mmc.c int spl_mmc_load(struct spl_image_info *spl_image, · line 455

Quoted 5 lines
common/spl/spl_mmc.c +2 -0
+		if (!err)
+			return err;
  		/* Fall through */
  	case MMCSD_MODE_RAW:
  		debug("spl: mmc boot mode: raw\n");

So why doesn't the mmc_load_image_raw_sector below (line 475 or so) work?

boot_mode that I choose is MMCSD_MODE_EMMCBOOT. This is a switch case method. If the case finished execution, program will jump to 'return error;' in line 492. Since there are no load image function, in boot_mode: MMCSD_MODE_EMMCBOOT, it will just switch the hwpartition and quit the process & fail to boot.

case MMCSD_MODE_EMMCBOOT:
*** here is the case I add mmc_load_image_raw_sector()
/* Fall through */
case MMCSD_MODE_RAW:
*** here is the case which execute mmc_load_image_raw_sector() in line 470.

Quoted 2 lines

--Sean

Please correct me if I am wrong.
--KuanLim

#6 lore raw

Hi Anderson,

Thanks for your feedback.
Please ignore this patch.

Best Regards,
KuanLim

Quoted 48 lines · Kuan Lim Lee
Quoted 12 lines · Sean Anderson
Quoted 1 line · Kuan Lim Lee

When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not

load

Quoted 9 lines

U-boot proper image after switched hardware partition.

---
  common/spl/spl_mmc.c | 3 +++
  1 file changed, 3 insertions(+)
Quoted 5 lines

common/spl/spl_mmc.c int spl_mmc_load(struct spl_image_info

Quoted 5 lines
common/spl/spl_mmc.c index renamed from common/spl/spl_mmc.c +0 -0

20f687e138..dc8a45222b 100644

common/spl/spl_mmc.c +0 -0
@@ -447,6 +447,9 @@ int spl_mmc_load(struct spl_image_info

*spl_image,

Quoted 5 lines

common/spl/spl_mmc.c int spl_mmc_load(struct spl_image_info *spl_image,

Quoted 4 lines
common/spl/spl_mmc.c +1 -0
  #endif
  			return err;
  		}
+		err = mmc_load_image_raw_sector(spl_image, bootdev, mmc,

0);

Quoted 7 lines

common/spl/spl_mmc.c int spl_mmc_load(struct spl_image_info *spl_image, · line 455

Quoted 5 lines
common/spl/spl_mmc.c +2 -0
+		if (!err)
+			return err;
  		/* Fall through */
  	case MMCSD_MODE_RAW:
  		debug("spl: mmc boot mode: raw\n");

So why doesn't the mmc_load_image_raw_sector below (line 475 or so)

work?
boot_mode that I choose is MMCSD_MODE_EMMCBOOT. This is a switch case method.
If the case finished execution, program will jump to 'return error;' in line 492. Since there are no load image function, in boot_mode:
MMCSD_MODE_EMMCBOOT, it will just switch the hwpartition and quit the process & fail to boot.

case MMCSD_MODE_EMMCBOOT:
*** here is the case I add mmc_load_image_raw_sector()
/* Fall through */
case MMCSD_MODE_RAW:
*** here is the case which execute mmc_load_image_raw_sector() in line 470.

Quoted 2 lines

--Sean

Please correct me if I am wrong.
--KuanLim

Reviewed-by on v1 1/1
#7 lore raw
In reply to Kuan Lim Lee
Quoted 6 lines · Kuan Lim Lee

When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not load U-boot proper image after switched hardware partition.

Best Regards,
Jaehoon Chung

Quoted 18 lines
---
 common/spl/spl_mmc.c | 3 +++
 1 file changed, 3 insertions(+)
common/spl/spl_mmc.c +3 -0
index 20f687e138..dc8a45222b 100644
@@ -447,6 +447,9 @@ int spl_mmc_load(struct spl_image_info *spl_image,
 #endif
 			return err;
 		}
+		err = mmc_load_image_raw_sector(spl_image, bootdev, mmc, 0);
+		if (!err)
+			return err;
 		/* Fall through */
 	case MMCSD_MODE_RAW:
 		debug("spl: mmc boot mode: raw\n");