public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Julien Masson <jmasson@baylibre.com>
To: u-boot@lists.denx.de
Cc: Simon Glass <sjg@chromium.org>
Subject: [PATCH v2 2/2] splash: get devpart from environment variable
Date: Mon, 17 Oct 2022 10:33:22 +0200	[thread overview]
Message-ID: <87czaq6e99.fsf@baylibre.com> (raw)
In-Reply-To: <87fsfm6e9d.fsf@baylibre.com>

By default several types of splash locations are supported and the
user can select one of them through environment var (splashsource).

However the devpart is still hardcoded and we cannot change it from
the environment.

This patch add the support of "splashdevpart" which allow the user to
set the devpart though this environment variable.

Example: image located in splashscreen partition (MMC as raw)
```
splashsource=mmc_raw
splashdevpart=0#splashscreen
```

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Julien Masson <jmasson@baylibre.com>
---

Changes in v2:
- rename local var env_splashdevpart_value to devpart

 common/splash_source.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/splash_source.c b/common/splash_source.c
index 68c9fa371b..a260137619 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -448,6 +448,7 @@ int splash_source_load(struct splash_location *locations, uint size)
 {
 	struct splash_location *splash_location;
 	char *env_splashimage_value;
+	char *devpart;
 	u32 bmp_load_addr;
 
 	env_splashimage_value = env_get("splashimage");
@@ -464,6 +465,10 @@ int splash_source_load(struct splash_location *locations, uint size)
 	if (!splash_location)
 		return -EINVAL;
 
+	devpart = env_get("splashdevpart");
+	if (devpart)
+		splash_location->devpart = devpart;
+
 	if (splash_location->flags == SPLASH_STORAGE_RAW)
 		return splash_load_raw(splash_location, bmp_load_addr);
 	else if (splash_location->flags == SPLASH_STORAGE_FS)
-- 
2.37.3


  parent reply	other threads:[~2022-10-17  8:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17  8:33 [PATCH v2 0/2] splash: add more options/support Julien Masson
2022-10-17  8:33 ` [PATCH v2 1/2] splash: support raw image from MMC Julien Masson
2022-10-18 16:59   ` Simon Glass
2022-10-17  8:33 ` Julien Masson [this message]
2022-10-18 16:59   ` [PATCH v2 2/2] splash: get devpart from environment variable Simon Glass
2022-10-31 13:30 ` [PATCH v2 0/2] splash: add more options/support Anatolij Gustschin

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=87czaq6e99.fsf@baylibre.com \
    --to=jmasson@baylibre.com \
    --cc=sjg@chromium.org \
    --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