public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Westergreen, Dalon <dalon.westergreen@intel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] SPL: add support to boot from a partition type
Date: Sun, 29 Jan 2017 01:59:17 +0000	[thread overview]
Message-ID: <1485655155.12609.51.camel@intel.com> (raw)
In-Reply-To: <20170129000631.GN22316@bill-the-cat>

On Sat, 2017-01-28 at 19:06 -0500, Tom Rini wrote:
> On Sat, Jan 28, 2017 at 03:20:09PM -0800, Dalon Westergreen wrote:
> 
> > 
> > From: Dalon Westergreen <dalon.westergreen@intel.com>
> > 
> > the socfpga bootrom supports mmc booting from either a raw image
> > starting at 0x0, or from a partition of type 0xa2.??This patch
> > adds support for locating the boot image in the first type 0xa2
> > partition found.
> > 
> > Signed-off-by: Dalon Westergreen <dalon.westergreen@intel.com>
> > ---
> > ?common/spl/Kconfig???| 17 +++++++++++++++++
> > ?common/spl/spl_mmc.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
> > ?disk/part_dos.c??????|??1 +
> > ?include/part.h???????|??1 +
> > ?4 files changed, 63 insertions(+), 1 deletion(-)
> 
> Today socfpga sets SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION to 1.??Do you
> really have enough cases where the special partition isn't going to be
> likely known when building U-Boot for a given platform?
All of our kits actually ship with the third partition being the 0xa2
partition. ?Normally the 1 partition is the fat partition. ?I want to
support the case where the 0xa2 partition is arbitrary and used only for
the SPL. ?the 1 partition is a fat partition with the full u-boot image.

> 
> The code itself looks fine (I don't see an easy way to get at the
> max_entries field of the partition type struct, but assuming that the
> ROM only support MBR tables today you could use the DOS_ENTRY_NUMBERS
> constant with a comment above it).??But we're making this bit of code
> even more complex and adding more #ifdefs.
> 
> [snip]
> > 
> > @@ -331,12 +367,19 @@ int spl_mmc_load_image(struct spl_image_info
> > *spl_image,
> > ?			CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);
> > ?		if (!err)
> > ?			return err;
> > +		
> > +#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
> > +		err = mmc_load_image_raw_partition_type(spl_image, mmc,
> > +			CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE);
> > +		if (!err)
> > +			return err;
> > +#endif
> 
> ... but couldn't we re-structure things so that both of the "boot from a
> partition" options take the same point from spl_mmc_load_image() instead
> set a partition variable depending on static/dynamic partition # being
> used???Or would that make things even messier looking???Thanks!
> 
yes, i like this. ?seems cleaner.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

  reply	other threads:[~2017-01-29  1:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-28 23:20 [U-Boot] [PATCH] SPL: add support to boot from a partition type Dalon Westergreen
2017-01-29  0:06 ` Tom Rini
2017-01-29  1:59   ` Westergreen, Dalon [this message]
2017-01-29  2:05     ` Tom Rini
2017-01-29  2:14       ` Westergreen, Dalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485655155.12609.51.camel@intel.com \
    --to=dalon.westergreen@intel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox