All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] venice: show emmc boot hardware partition
@ 2024-04-26 16:55 Tim Harvey
  2024-04-26 19:26 ` Dragan Simic
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Harvey @ 2024-04-26 16:55 UTC (permalink / raw)
  To: Fabio Estevam, u-boot; +Cc: Tim Harvey

To aid in understanding what emmc hardware partition is being
used to boot on power-up, display the hardware partition name in the
SPL.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/venice/spl.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/board/gateworks/venice/spl.c b/board/gateworks/venice/spl.c
index 3b0f11f2fd0f..531bad260b6d 100644
--- a/board/gateworks/venice/spl.c
+++ b/board/gateworks/venice/spl.c
@@ -366,9 +366,25 @@ unsigned long board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long
 
 const char *spl_board_loader_name(u32 boot_device)
 {
+	struct mmc *mmc;
+	int part;
+
 	switch (boot_device) {
 	/* SDHC2 */
 	case BOOT_DEVICE_MMC1:
+		mmc_init_device(0);
+		mmc = find_mmc_device(0);
+		mmc_init(mmc);
+		part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
+		switch (part) {
+		case 1:
+			return "eMMC boot0";
+		case 2:
+			return "eMMC boot1";
+		case 0:
+		case 7:
+			return "eMMC user";
+		}
 		return "eMMC";
 	/* SDHC3 */
 	case BOOT_DEVICE_MMC2:
-- 
2.25.1


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

* Re: [PATCH] venice: show emmc boot hardware partition
  2024-04-26 16:55 [PATCH] venice: show emmc boot hardware partition Tim Harvey
@ 2024-04-26 19:26 ` Dragan Simic
  2024-04-27  0:08   ` Tim Harvey
  0 siblings, 1 reply; 3+ messages in thread
From: Dragan Simic @ 2024-04-26 19:26 UTC (permalink / raw)
  To: Tim Harvey; +Cc: Fabio Estevam, u-boot, Marek Vasut

Hello Tim,

Please see my comments below.

On 2024-04-26 18:55, Tim Harvey wrote:
> To aid in understanding what emmc hardware partition is being
> used to boot on power-up, display the hardware partition name in the
> SPL.
> 
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
>  board/gateworks/venice/spl.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/board/gateworks/venice/spl.c 
> b/board/gateworks/venice/spl.c
> index 3b0f11f2fd0f..531bad260b6d 100644
> --- a/board/gateworks/venice/spl.c
> +++ b/board/gateworks/venice/spl.c
> @@ -366,9 +366,25 @@ unsigned long
> board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long
> 
>  const char *spl_board_loader_name(u32 boot_device)
>  {
> +	struct mmc *mmc;
> +	int part;
> +
>  	switch (boot_device) {
>  	/* SDHC2 */
>  	case BOOT_DEVICE_MMC1:
> +		mmc_init_device(0);
> +		mmc = find_mmc_device(0);
> +		mmc_init(mmc);
> +		part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
> +		switch (part) {
> +		case 1:
> +			return "eMMC boot0";
> +		case 2:
> +			return "eMMC boot1";
> +		case 0:
> +		case 7:
> +			return "eMMC user";
> +		}
>  		return "eMMC";
>  	/* SDHC3 */
>  	case BOOT_DEVICE_MMC2:

Your other patch on the mailing list does something similar. [1]
Perhaps this is a good oportunity to extract and unify the logic
that produces the names of eMMC partitions?  That would also allow
other boards to use the same logic.

[1] 
https://lore.kernel.org/u-boot/a1e9206f-0cbf-44b2-a5e7-351f77c0d2b5@denx.de/T/#u

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

* Re: [PATCH] venice: show emmc boot hardware partition
  2024-04-26 19:26 ` Dragan Simic
@ 2024-04-27  0:08   ` Tim Harvey
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Harvey @ 2024-04-27  0:08 UTC (permalink / raw)
  To: Dragan Simic; +Cc: Fabio Estevam, u-boot, Marek Vasut

On Fri, Apr 26, 2024 at 12:26 PM Dragan Simic <dsimic@manjaro.org> wrote:
>
> Hello Tim,
>
> Please see my comments below.
>
> On 2024-04-26 18:55, Tim Harvey wrote:
> > To aid in understanding what emmc hardware partition is being
> > used to boot on power-up, display the hardware partition name in the
> > SPL.
> >
> > Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> > ---
> >  board/gateworks/venice/spl.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/board/gateworks/venice/spl.c
> > b/board/gateworks/venice/spl.c
> > index 3b0f11f2fd0f..531bad260b6d 100644
> > --- a/board/gateworks/venice/spl.c
> > +++ b/board/gateworks/venice/spl.c
> > @@ -366,9 +366,25 @@ unsigned long
> > board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long
> >
> >  const char *spl_board_loader_name(u32 boot_device)
> >  {
> > +     struct mmc *mmc;
> > +     int part;
> > +
> >       switch (boot_device) {
> >       /* SDHC2 */
> >       case BOOT_DEVICE_MMC1:
> > +             mmc_init_device(0);
> > +             mmc = find_mmc_device(0);
> > +             mmc_init(mmc);
> > +             part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
> > +             switch (part) {
> > +             case 1:
> > +                     return "eMMC boot0";
> > +             case 2:
> > +                     return "eMMC boot1";
> > +             case 0:
> > +             case 7:
> > +                     return "eMMC user";
> > +             }
> >               return "eMMC";
> >       /* SDHC3 */
> >       case BOOT_DEVICE_MMC2:
>
> Your other patch on the mailing list does something similar. [1]
> Perhaps this is a good oportunity to extract and unify the logic
> that produces the names of eMMC partitions?  That would also allow
> other boards to use the same logic.
>

Hi Dragan,

Fair enough - I will resubmit both patches with this in mind.

Best Regards

Tim

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

end of thread, other threads:[~2024-04-27  0:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26 16:55 [PATCH] venice: show emmc boot hardware partition Tim Harvey
2024-04-26 19:26 ` Dragan Simic
2024-04-27  0:08   ` Tim Harvey

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.