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
Subject: [PATCH 2/2] splash: get devpart from environment variable
Date: Mon, 19 Sep 2022 15:36:58 +0200	[thread overview]
Message-ID: <87h713o58l.fsf@baylibre.com> (raw)
In-Reply-To: <87k05zo58p.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
```

Signed-off-by: Julien Masson <jmasson@baylibre.com>
---
 common/splash_source.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/splash_source.c b/common/splash_source.c
index c512aa0196..a7764ff16f 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -451,6 +451,7 @@ int splash_source_load(struct splash_location *locations, uint size)
 {
 	struct splash_location *splash_location;
 	char *env_splashimage_value;
+	char *env_splashdevpart_value;
 	u32 bmp_load_addr;
 
 	env_splashimage_value = env_get("splashimage");
@@ -467,6 +468,10 @@ int splash_source_load(struct splash_location *locations, uint size)
 	if (!splash_location)
 		return -EINVAL;
 
+	env_splashdevpart_value = env_get("splashdevpart");
+	if (env_splashdevpart_value)
+		splash_location->devpart = env_splashdevpart_value;
+
 	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-09-19 13:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 13:36 [PATCH 0/2] splash: add more options/support Julien Masson
2022-09-19 13:36 ` [PATCH 1/2] splash: support raw image from MMC Julien Masson
2022-09-19 13:36 ` Julien Masson [this message]

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=87h713o58l.fsf@baylibre.com \
    --to=jmasson@baylibre.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