public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition
@ 2023-10-03  4:16 ` Kuan Lim Lee
  2023-10-10  8:14   ` KuanLim.Lee
                     ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Kuan Lim Lee @ 2023-10-03  4:16 UTC (permalink / raw)
  To: u-boot; +Cc: cheehong.ang, weiliang.lim, Kuan Lim Lee

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

Signed-off-by: Kuan Lim Lee <kuanlim.lee@starfivetech.com>
Reviewed-by: Chee Hong Ang <cheehong.ang@starfivetech.com>
Reviewed-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
---
 common/spl/spl_mmc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 20f687e138..dc8a45222b 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -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


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

* RE: [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition
  2023-10-03  4:16 ` [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition Kuan Lim Lee
@ 2023-10-10  8:14   ` KuanLim.Lee
  2023-10-17  4:53   ` KuanLim.Lee
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: KuanLim.Lee @ 2023-10-10  8:14 UTC (permalink / raw)
  To: u-boot@lists.denx.de; +Cc: Cheehong Ang, WeiLiang Lim

Hi,

Is this patch considered as accepted?

> -----Original Message-----
> From: KuanLim.Lee <kuanlim.lee@starfivetech.com>
> Sent: Tuesday, October 3, 2023 12:17 PM
> To: u-boot@lists.denx.de
> Cc: Cheehong Ang <cheehong.ang@starfivetech.com>; WeiLiang Lim
> <weiliang.lim@starfivetech.com>; KuanLim.Lee
> <kuanlim.lee@starfivetech.com>
> 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.
> 
> Signed-off-by: Kuan Lim Lee <kuanlim.lee@starfivetech.com>
> Reviewed-by: Chee Hong Ang <cheehong.ang@starfivetech.com>
> Reviewed-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
> ---
>  common/spl/spl_mmc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index
> 20f687e138..dc8a45222b 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -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


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

* RE: [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition
  2023-10-03  4:16 ` [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition Kuan Lim Lee
  2023-10-10  8:14   ` KuanLim.Lee
@ 2023-10-17  4:53   ` KuanLim.Lee
  2023-10-18  4:51     ` Lothar Waßmann
  2023-10-18  5:27   ` Sean Anderson
  2023-10-31  5:04   ` Jaehoon Chung
  3 siblings, 1 reply; 8+ messages in thread
From: KuanLim.Lee @ 2023-10-17  4:53 UTC (permalink / raw)
  To: u-boot@lists.denx.de; +Cc: Cheehong Ang, WeiLiang Lim

Hi maintainers,

Could anyone of you help to review the patch?

> -----Original Message-----
> From: KuanLim.Lee <kuanlim.lee@starfivetech.com>
> Sent: Tuesday, October 3, 2023 12:17 PM
> To: u-boot@lists.denx.de
> Cc: Cheehong Ang <cheehong.ang@starfivetech.com>; WeiLiang Lim
> <weiliang.lim@starfivetech.com>; KuanLim.Lee
> <kuanlim.lee@starfivetech.com>
> 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.
> 
> Signed-off-by: Kuan Lim Lee <kuanlim.lee@starfivetech.com>
> Reviewed-by: Chee Hong Ang <cheehong.ang@starfivetech.com>
> Reviewed-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
> ---
>  common/spl/spl_mmc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index
> 20f687e138..dc8a45222b 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -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


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

* Re: [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition
  2023-10-17  4:53   ` KuanLim.Lee
@ 2023-10-18  4:51     ` Lothar Waßmann
  0 siblings, 0 replies; 8+ messages in thread
From: Lothar Waßmann @ 2023-10-18  4:51 UTC (permalink / raw)
  To: KuanLim.Lee; +Cc: u-boot@lists.denx.de, Cheehong Ang, WeiLiang Lim

Hi,

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

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

* Re: [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition
  2023-10-03  4:16 ` [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition Kuan Lim Lee
  2023-10-10  8:14   ` KuanLim.Lee
  2023-10-17  4:53   ` KuanLim.Lee
@ 2023-10-18  5:27   ` Sean Anderson
  2023-10-18  6:20     ` KuanLim.Lee
  2023-10-31  5:04   ` Jaehoon Chung
  3 siblings, 1 reply; 8+ messages in thread
From: Sean Anderson @ 2023-10-18  5:27 UTC (permalink / raw)
  To: Kuan Lim Lee, u-boot; +Cc: cheehong.ang, weiliang.lim

On 10/3/23 00:16, Kuan Lim Lee wrote:
> When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not load U-boot
> proper image after switched hardware partition.
> 
> Signed-off-by: Kuan Lim Lee <kuanlim.lee@starfivetech.com>
> Reviewed-by: Chee Hong Ang <cheehong.ang@starfivetech.com>
> Reviewed-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
> ---
>   common/spl/spl_mmc.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 20f687e138..dc8a45222b 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -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

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

* RE: [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition
  2023-10-18  5:27   ` Sean Anderson
@ 2023-10-18  6:20     ` KuanLim.Lee
  2023-10-18  7:17       ` KuanLim.Lee
  0 siblings, 1 reply; 8+ messages in thread
From: KuanLim.Lee @ 2023-10-18  6:20 UTC (permalink / raw)
  To: Sean Anderson, u-boot@lists.denx.de; +Cc: Cheehong Ang, WeiLiang Lim

On 10/18/23 13:27, Sean Anderson wrote:
> On 10/3/23 00:16, Kuan Lim Lee wrote:
> > When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not
> load
> > U-boot proper image after switched hardware partition.
> >
> > Signed-off-by: Kuan Lim Lee <kuanlim.lee@starfivetech.com>
> > Reviewed-by: Chee Hong Ang <cheehong.ang@starfivetech.com>
> > Reviewed-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
> > ---
> >   common/spl/spl_mmc.c | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index
> > 20f687e138..dc8a45222b 100644
> > --- a/common/spl/spl_mmc.c
> > +++ b/common/spl/spl_mmc.c
> > @@ -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?
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.
> 
> --Sean
Please correct me if I am wrong.
--KuanLim

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

* RE: [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition
  2023-10-18  6:20     ` KuanLim.Lee
@ 2023-10-18  7:17       ` KuanLim.Lee
  0 siblings, 0 replies; 8+ messages in thread
From: KuanLim.Lee @ 2023-10-18  7:17 UTC (permalink / raw)
  To: Sean Anderson, u-boot@lists.denx.de; +Cc: Cheehong Ang, WeiLiang Lim

Hi Anderson,

Thanks for your feedback. 
Please ignore this patch.

Best Regards,
KuanLim

On 10/3/23 14:21, Kuan Lim Lee wrote:
> On 10/18/23 13:27, Sean Anderson wrote:
> > On 10/3/23 00:16, Kuan Lim Lee wrote:
> > > When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not
> > load
> > > U-boot proper image after switched hardware partition.
> > >
> > > Signed-off-by: Kuan Lim Lee <kuanlim.lee@starfivetech.com>
> > > Reviewed-by: Chee Hong Ang <cheehong.ang@starfivetech.com>
> > > Reviewed-by: Wei Liang Lim <weiliang.lim@starfivetech.com>
> > > ---
> > >   common/spl/spl_mmc.c | 3 +++
> > >   1 file changed, 3 insertions(+)
> > >
> > > diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index
> > > 20f687e138..dc8a45222b 100644
> > > --- a/common/spl/spl_mmc.c
> > > +++ b/common/spl/spl_mmc.c
> > > @@ -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?
> 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.
> >
> > --Sean
> Please correct me if I am wrong.
> --KuanLim

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

* Re: [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition
  2023-10-03  4:16 ` [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition Kuan Lim Lee
                     ` (2 preceding siblings ...)
  2023-10-18  5:27   ` Sean Anderson
@ 2023-10-31  5:04   ` Jaehoon Chung
  3 siblings, 0 replies; 8+ messages in thread
From: Jaehoon Chung @ 2023-10-31  5:04 UTC (permalink / raw)
  To: Kuan Lim Lee, u-boot; +Cc: cheehong.ang, weiliang.lim

On 10/3/23 13:16, Kuan Lim Lee wrote:
> When selecting MMCSD_MODE_EMMCBOOT as boot_mode, emmc do not load U-boot 
> proper image after switched hardware partition.
> 
> Signed-off-by: Kuan Lim Lee <kuanlim.lee@starfivetech.com>
> Reviewed-by: Chee Hong Ang <cheehong.ang@starfivetech.com>
> Reviewed-by: Wei Liang Lim <weiliang.lim@starfivetech.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  common/spl/spl_mmc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 20f687e138..dc8a45222b 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -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");


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

end of thread, other threads:[~2023-10-31  5:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20231031050430epcas1p2ce44601cc5a47f0a768ebbfd837798a6@epcas1p2.samsung.com>
2023-10-03  4:16 ` [PATCH] spl: mmc: Resolve emmc not load image after switched hw partition Kuan Lim Lee
2023-10-10  8:14   ` KuanLim.Lee
2023-10-17  4:53   ` KuanLim.Lee
2023-10-18  4:51     ` Lothar Waßmann
2023-10-18  5:27   ` Sean Anderson
2023-10-18  6:20     ` KuanLim.Lee
2023-10-18  7:17       ` KuanLim.Lee
2023-10-31  5:04   ` Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox