From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] spl: spl_mmc: provide one weak function spl_boot_partition
Date: Tue, 20 Mar 2018 15:10:45 +0100 [thread overview]
Message-ID: <20180320151045.45d04de6@jawa> (raw)
In-Reply-To: <1521539694-16598-1-git-send-email-patrick.delaunay@st.com>
On Tue, 20 Mar 2018 10:54:51 +0100
Patrick Delaunay <patrick.delaunay@st.com> wrote:
> The spl_boot_partition function has been added in order to have
> the possibility to boot on a same binary from different mmc devices
> with different partitions.
>
> By default keep the current behavior, SPL use the partition defined
> by CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> Signed-off-by: Christophe KERELLO <christophe.kerello@st.com>
> ---
>
> common/spl/spl_mmc.c | 15 +++++++++++++--
> include/spl.h | 1 +
> 2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 351f4ed..4aa0b2c 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -292,6 +292,14 @@ u32 __weak spl_boot_mode(const u32 boot_device)
> #endif
> }
>
> +#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
> +__weak
> +int spl_boot_partition(const u32 boot_device)
> +{
> + return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION;
> +}
> +#endif
> +
> int spl_mmc_load_image(struct spl_image_info *spl_image,
> struct spl_boot_device *bootdev)
> {
> @@ -347,8 +355,11 @@ int spl_mmc_load_image(struct spl_image_info
> *spl_image, return err;
> }
> #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
> - err = mmc_load_image_raw_partition(spl_image, mmc,
> - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);
> + err = spl_boot_partition(bootdev->boot_device);
> + if (!err)
> + return err;
> +
> + err = mmc_load_image_raw_partition(spl_image, mmc,
> err); if (!err)
> return err;
> #endif
> diff --git a/include/spl.h b/include/spl.h
> index c14448b..5754012 100644
> --- a/include/spl.h
> +++ b/include/spl.h
> @@ -82,6 +82,7 @@ int spl_load_simple_fit(struct spl_image_info
> *spl_image, void preloader_console_init(void);
> u32 spl_boot_device(void);
> u32 spl_boot_mode(const u32 boot_device);
> +int spl_boot_partition(const u32 boot_device);
> void spl_set_bd(void);
>
> /**
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180320/1204962e/attachment.sig>
next prev parent reply other threads:[~2018-03-20 14:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-20 9:54 [U-Boot] [PATCH 1/4] spl: spl_mmc: provide one weak function spl_boot_partition Patrick Delaunay
2018-03-20 9:54 ` [U-Boot] [PATCH 2/4] stm32mp1: add eMMC support for ED1 Patrick Delaunay
2018-04-07 13:24 ` [U-Boot] [U-Boot,2/4] " Tom Rini
2018-03-20 9:54 ` [U-Boot] [PATCH 3/4] stm32mp1: get boot mode from BootRom Patrick Delaunay
2018-04-07 13:24 ` [U-Boot] [U-Boot,3/4] " Tom Rini
2018-03-20 9:54 ` [U-Boot] [PATCH 4/4] stm32mp1: select boot device and partition Patrick Delaunay
2018-04-07 13:25 ` [U-Boot] [U-Boot, " Tom Rini
2018-03-20 13:24 ` [U-Boot] [PATCH 1/4] spl: spl_mmc: provide one weak function spl_boot_partition Tom Rini
2018-03-20 14:10 ` Lukasz Majewski [this message]
2018-04-07 13:24 ` [U-Boot] [U-Boot, " Tom Rini
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=20180320151045.45d04de6@jawa \
--to=lukma@denx.de \
--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