[U-Boot] [PATCH] SPL: add support to boot from a partition type

Westergreen, Dalon dalon.westergreen at intel.com
Sun Jan 29 03:14:42 CET 2017


On Sat, 2017-01-28 at 21:05 -0500, Tom Rini wrote:
> On Sun, Jan 29, 2017 at 01:59:17AM +0000, Westergreen, Dalon wrote:
> > 
> > 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 at 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 at 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.
> 
> Er, this code is where we determine where to load U-Boot from, SPL is
> running.  So if I follow you, the bootrom would load SPL from the
> partition with 0xa2 as the type, usually #3 and then we load U-Boot from
> the FAT partition (which would be SPL_FS_LOAD_PAYLOAD_NAME and such) ?
> 
yes, or if FAT isn't enabled, the spl would load the image in the 0xa2
partition or the CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION offset by
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR.  Both are reasonable and 
supported.  my current thought is if partition = -1 and 
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE is set then search
for the a2 partition.  work for you?

--dalon


More information about the U-Boot mailing list