diff mbox series

[v2,2/2] splash: get devpart from environment variable

Message ID 87czaq6e99.fsf@baylibre.com
State Accepted
Delegated to: Anatolij Gustschin
Headers show
Series splash: add more options/support | expand

Commit Message

Julien Masson Oct. 17, 2022, 8:33 a.m. UTC
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(+)

Comments

Simon Glass Oct. 18, 2022, 4:59 p.m. UTC | #1
On Mon, 17 Oct 2022 at 02:33, Julien Masson <jmasson@baylibre.com> wrote:
>
> 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(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

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)