From: Tom Rini Date: Sat, 28 Jan 2017 19:06:31 -0500 Subject: [U-Boot] [PATCH] SPL: add support to boot from a partition type In-Reply-To: <1485645609-21831-1-git-send-email-dwesterg@gmail.com> References: <1485645609-21831-1-git-send-email-dwesterg@gmail.com> Message-ID: <20170129000631.GN22316@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, Jan 28, 2017 at 03:20:09PM -0800, Dalon Westergreen wrote: > From: Dalon Westergreen > > 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 > --- > 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? 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! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: