U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] env_mmc: Allow SPL to use any MMC device to load/save the environment
@ 2017-02-01 10:26 Jean-Jacques Hiblot
  2017-02-14 13:16 ` Jean-Jacques Hiblot
  2017-04-09  1:14 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 6+ messages in thread
From: Jean-Jacques Hiblot @ 2017-02-01 10:26 UTC (permalink / raw)
  To: u-boot

SPL has been restricted to use only dev 0 based on the assumption that only
one MMC device is registered. This is not always the case and many
platforms now register several devices as expected by the spl mmc boot code
For those platform SPL_ENV_SUPPORT is broken if dev is forced to 0.

A word of warning: this commit may break SPL_ENV_SUPPORT on platforms that
do not register the same MMC controllers in SPL and in u-boot (mostly iMX6
based platforms). Fortunately none of those activate SPL_ENV_SUPPORT in
their default configuration.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---
 common/env_mmc.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index 16f6a17..a5d14d4 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -82,10 +82,6 @@ static int mmc_set_env_part(struct mmc *mmc)
 	int dev = mmc_get_env_dev();
 	int ret = 0;
 
-#ifdef CONFIG_SPL_BUILD
-	dev = 0;
-#endif
-
 	env_mmc_orig_hwpart = mmc_get_blk_desc(mmc)->hwpart;
 	ret = blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part);
 	if (ret)
@@ -116,9 +112,6 @@ static void fini_mmc_for_env(struct mmc *mmc)
 #ifdef CONFIG_SYS_MMC_ENV_PART
 	int dev = mmc_get_env_dev();
 
-#ifdef CONFIG_SPL_BUILD
-	dev = 0;
-#endif
 	blk_select_hwpart_devnum(IF_TYPE_MMC, dev, env_mmc_orig_hwpart);
 #endif
 }
@@ -223,10 +216,6 @@ void env_relocate_spec(void)
 	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env1, 1);
 	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env2, 1);
 
-#ifdef CONFIG_SPL_BUILD
-	dev = 0;
-#endif
-
 	mmc = find_mmc_device(dev);
 
 	errmsg = init_mmc_for_env(mmc);
@@ -306,10 +295,6 @@ void env_relocate_spec(void)
 	int dev = mmc_get_env_dev();
 	const char *errmsg;
 
-#ifdef CONFIG_SPL_BUILD
-	dev = 0;
-#endif
-
 	mmc = find_mmc_device(dev);
 
 	errmsg = init_mmc_for_env(mmc);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] env_mmc: Allow SPL to use any MMC device to load/save the environment
  2017-02-01 10:26 [U-Boot] [PATCH] env_mmc: Allow SPL to use any MMC device to load/save the environment Jean-Jacques Hiblot
@ 2017-02-14 13:16 ` Jean-Jacques Hiblot
  2017-02-14 18:52   ` Tom Rini
  2017-04-09  1:14 ` [U-Boot] " Tom Rini
  1 sibling, 1 reply; 6+ messages in thread
From: Jean-Jacques Hiblot @ 2017-02-14 13:16 UTC (permalink / raw)
  To: u-boot

Hi Tom,

Have you had a chance to look at the patch below?

Jean-Jacques


On 01/02/2017 11:26, Jean-Jacques Hiblot wrote:
> SPL has been restricted to use only dev 0 based on the assumption that only
> one MMC device is registered. This is not always the case and many
> platforms now register several devices as expected by the spl mmc boot code
> For those platform SPL_ENV_SUPPORT is broken if dev is forced to 0.
>
> A word of warning: this commit may break SPL_ENV_SUPPORT on platforms that
> do not register the same MMC controllers in SPL and in u-boot (mostly iMX6
> based platforms). Fortunately none of those activate SPL_ENV_SUPPORT in
> their default configuration.
>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> ---
>   common/env_mmc.c | 15 ---------------
>   1 file changed, 15 deletions(-)
>
> diff --git a/common/env_mmc.c b/common/env_mmc.c
> index 16f6a17..a5d14d4 100644
> --- a/common/env_mmc.c
> +++ b/common/env_mmc.c
> @@ -82,10 +82,6 @@ static int mmc_set_env_part(struct mmc *mmc)
>   	int dev = mmc_get_env_dev();
>   	int ret = 0;
>   
> -#ifdef CONFIG_SPL_BUILD
> -	dev = 0;
> -#endif
> -
>   	env_mmc_orig_hwpart = mmc_get_blk_desc(mmc)->hwpart;
>   	ret = blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part);
>   	if (ret)
> @@ -116,9 +112,6 @@ static void fini_mmc_for_env(struct mmc *mmc)
>   #ifdef CONFIG_SYS_MMC_ENV_PART
>   	int dev = mmc_get_env_dev();
>   
> -#ifdef CONFIG_SPL_BUILD
> -	dev = 0;
> -#endif
>   	blk_select_hwpart_devnum(IF_TYPE_MMC, dev, env_mmc_orig_hwpart);
>   #endif
>   }
> @@ -223,10 +216,6 @@ void env_relocate_spec(void)
>   	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env1, 1);
>   	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env2, 1);
>   
> -#ifdef CONFIG_SPL_BUILD
> -	dev = 0;
> -#endif
> -
>   	mmc = find_mmc_device(dev);
>   
>   	errmsg = init_mmc_for_env(mmc);
> @@ -306,10 +295,6 @@ void env_relocate_spec(void)
>   	int dev = mmc_get_env_dev();
>   	const char *errmsg;
>   
> -#ifdef CONFIG_SPL_BUILD
> -	dev = 0;
> -#endif
> -
>   	mmc = find_mmc_device(dev);
>   
>   	errmsg = init_mmc_for_env(mmc);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] env_mmc: Allow SPL to use any MMC device to load/save the environment
  2017-02-14 13:16 ` Jean-Jacques Hiblot
@ 2017-02-14 18:52   ` Tom Rini
  2017-02-15  9:05     ` Jean-Jacques Hiblot
  2017-04-07 12:02     ` Jean-Jacques Hiblot
  0 siblings, 2 replies; 6+ messages in thread
From: Tom Rini @ 2017-02-14 18:52 UTC (permalink / raw)
  To: u-boot

On Tue, Feb 14, 2017 at 02:16:13PM +0100, Jean-Jacques Hiblot wrote:

> Hi Tom,
> 
> Have you had a chance to look at the patch below?

It looks fine but was too close to the release window (given the
potential impact) to merge.  Thanks!

> 
> Jean-Jacques
> 
> 
> On 01/02/2017 11:26, Jean-Jacques Hiblot wrote:
> >SPL has been restricted to use only dev 0 based on the assumption that only
> >one MMC device is registered. This is not always the case and many
> >platforms now register several devices as expected by the spl mmc boot code
> >For those platform SPL_ENV_SUPPORT is broken if dev is forced to 0.
> >
> >A word of warning: this commit may break SPL_ENV_SUPPORT on platforms that
> >do not register the same MMC controllers in SPL and in u-boot (mostly iMX6
> >based platforms). Fortunately none of those activate SPL_ENV_SUPPORT in
> >their default configuration.
> >
> >Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> >---
> >  common/env_mmc.c | 15 ---------------
> >  1 file changed, 15 deletions(-)
> >
> >diff --git a/common/env_mmc.c b/common/env_mmc.c
> >index 16f6a17..a5d14d4 100644
> >--- a/common/env_mmc.c
> >+++ b/common/env_mmc.c
> >@@ -82,10 +82,6 @@ static int mmc_set_env_part(struct mmc *mmc)
> >  	int dev = mmc_get_env_dev();
> >  	int ret = 0;
> >-#ifdef CONFIG_SPL_BUILD
> >-	dev = 0;
> >-#endif
> >-
> >  	env_mmc_orig_hwpart = mmc_get_blk_desc(mmc)->hwpart;
> >  	ret = blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part);
> >  	if (ret)
> >@@ -116,9 +112,6 @@ static void fini_mmc_for_env(struct mmc *mmc)
> >  #ifdef CONFIG_SYS_MMC_ENV_PART
> >  	int dev = mmc_get_env_dev();
> >-#ifdef CONFIG_SPL_BUILD
> >-	dev = 0;
> >-#endif
> >  	blk_select_hwpart_devnum(IF_TYPE_MMC, dev, env_mmc_orig_hwpart);
> >  #endif
> >  }
> >@@ -223,10 +216,6 @@ void env_relocate_spec(void)
> >  	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env1, 1);
> >  	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env2, 1);
> >-#ifdef CONFIG_SPL_BUILD
> >-	dev = 0;
> >-#endif
> >-
> >  	mmc = find_mmc_device(dev);
> >  	errmsg = init_mmc_for_env(mmc);
> >@@ -306,10 +295,6 @@ void env_relocate_spec(void)
> >  	int dev = mmc_get_env_dev();
> >  	const char *errmsg;
> >-#ifdef CONFIG_SPL_BUILD
> >-	dev = 0;
> >-#endif
> >-
> >  	mmc = find_mmc_device(dev);
> >  	errmsg = init_mmc_for_env(mmc);
> 

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170214/c22a2023/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] env_mmc: Allow SPL to use any MMC device to load/save the environment
  2017-02-14 18:52   ` Tom Rini
@ 2017-02-15  9:05     ` Jean-Jacques Hiblot
  2017-04-07 12:02     ` Jean-Jacques Hiblot
  1 sibling, 0 replies; 6+ messages in thread
From: Jean-Jacques Hiblot @ 2017-02-15  9:05 UTC (permalink / raw)
  To: u-boot



On 14/02/2017 19:52, Tom Rini wrote:
> On Tue, Feb 14, 2017 at 02:16:13PM +0100, Jean-Jacques Hiblot wrote:
>
>> Hi Tom,
>>
>> Have you had a chance to look at the patch below?
> It looks fine but was too close to the release window (given the
> potential impact) to merge.  Thanks!
Ok Thank you for the feedback.
>
>> Jean-Jacques
>>
>>
>> On 01/02/2017 11:26, Jean-Jacques Hiblot wrote:
>>> SPL has been restricted to use only dev 0 based on the assumption that only
>>> one MMC device is registered. This is not always the case and many
>>> platforms now register several devices as expected by the spl mmc boot code
>>> For those platform SPL_ENV_SUPPORT is broken if dev is forced to 0.
>>>
>>> A word of warning: this commit may break SPL_ENV_SUPPORT on platforms that
>>> do not register the same MMC controllers in SPL and in u-boot (mostly iMX6
>>> based platforms). Fortunately none of those activate SPL_ENV_SUPPORT in
>>> their default configuration.
>>>
>>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
>>> ---
>>>   common/env_mmc.c | 15 ---------------
>>>   1 file changed, 15 deletions(-)
>>>
>>> diff --git a/common/env_mmc.c b/common/env_mmc.c
>>> index 16f6a17..a5d14d4 100644
>>> --- a/common/env_mmc.c
>>> +++ b/common/env_mmc.c
>>> @@ -82,10 +82,6 @@ static int mmc_set_env_part(struct mmc *mmc)
>>>   	int dev = mmc_get_env_dev();
>>>   	int ret = 0;
>>> -#ifdef CONFIG_SPL_BUILD
>>> -	dev = 0;
>>> -#endif
>>> -
>>>   	env_mmc_orig_hwpart = mmc_get_blk_desc(mmc)->hwpart;
>>>   	ret = blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part);
>>>   	if (ret)
>>> @@ -116,9 +112,6 @@ static void fini_mmc_for_env(struct mmc *mmc)
>>>   #ifdef CONFIG_SYS_MMC_ENV_PART
>>>   	int dev = mmc_get_env_dev();
>>> -#ifdef CONFIG_SPL_BUILD
>>> -	dev = 0;
>>> -#endif
>>>   	blk_select_hwpart_devnum(IF_TYPE_MMC, dev, env_mmc_orig_hwpart);
>>>   #endif
>>>   }
>>> @@ -223,10 +216,6 @@ void env_relocate_spec(void)
>>>   	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env1, 1);
>>>   	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env2, 1);
>>> -#ifdef CONFIG_SPL_BUILD
>>> -	dev = 0;
>>> -#endif
>>> -
>>>   	mmc = find_mmc_device(dev);
>>>   	errmsg = init_mmc_for_env(mmc);
>>> @@ -306,10 +295,6 @@ void env_relocate_spec(void)
>>>   	int dev = mmc_get_env_dev();
>>>   	const char *errmsg;
>>> -#ifdef CONFIG_SPL_BUILD
>>> -	dev = 0;
>>> -#endif
>>> -
>>>   	mmc = find_mmc_device(dev);
>>>   	errmsg = init_mmc_for_env(mmc);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] env_mmc: Allow SPL to use any MMC device to load/save the environment
  2017-02-14 18:52   ` Tom Rini
  2017-02-15  9:05     ` Jean-Jacques Hiblot
@ 2017-04-07 12:02     ` Jean-Jacques Hiblot
  1 sibling, 0 replies; 6+ messages in thread
From: Jean-Jacques Hiblot @ 2017-04-07 12:02 UTC (permalink / raw)
  To: u-boot



On 14/02/2017 19:52, Tom Rini wrote:
> On Tue, Feb 14, 2017 at 02:16:13PM +0100, Jean-Jacques Hiblot wrote:
>
>> Hi Tom,
>>
>> Have you had a chance to look at the patch below?
> It looks fine but was too close to the release window (given the
> potential impact) to merge.  Thanks!
Hi Tom,

Don't want to pester you. I'm just checking on the status regarding this 
patch. Without it the environment is not accessible in the SPL for the 
omap platforms and we rely on the environment for the falcon boot.

Jean-Jacques
>
>> Jean-Jacques
>>
>>
>> On 01/02/2017 11:26, Jean-Jacques Hiblot wrote:
>>> SPL has been restricted to use only dev 0 based on the assumption that only
>>> one MMC device is registered. This is not always the case and many
>>> platforms now register several devices as expected by the spl mmc boot code
>>> For those platform SPL_ENV_SUPPORT is broken if dev is forced to 0.
>>>
>>> A word of warning: this commit may break SPL_ENV_SUPPORT on platforms that
>>> do not register the same MMC controllers in SPL and in u-boot (mostly iMX6
>>> based platforms). Fortunately none of those activate SPL_ENV_SUPPORT in
>>> their default configuration.
>>>
>>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
>>> ---
>>>   common/env_mmc.c | 15 ---------------
>>>   1 file changed, 15 deletions(-)
>>>
>>> diff --git a/common/env_mmc.c b/common/env_mmc.c
>>> index 16f6a17..a5d14d4 100644
>>> --- a/common/env_mmc.c
>>> +++ b/common/env_mmc.c
>>> @@ -82,10 +82,6 @@ static int mmc_set_env_part(struct mmc *mmc)
>>>   	int dev = mmc_get_env_dev();
>>>   	int ret = 0;
>>> -#ifdef CONFIG_SPL_BUILD
>>> -	dev = 0;
>>> -#endif
>>> -
>>>   	env_mmc_orig_hwpart = mmc_get_blk_desc(mmc)->hwpart;
>>>   	ret = blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part);
>>>   	if (ret)
>>> @@ -116,9 +112,6 @@ static void fini_mmc_for_env(struct mmc *mmc)
>>>   #ifdef CONFIG_SYS_MMC_ENV_PART
>>>   	int dev = mmc_get_env_dev();
>>> -#ifdef CONFIG_SPL_BUILD
>>> -	dev = 0;
>>> -#endif
>>>   	blk_select_hwpart_devnum(IF_TYPE_MMC, dev, env_mmc_orig_hwpart);
>>>   #endif
>>>   }
>>> @@ -223,10 +216,6 @@ void env_relocate_spec(void)
>>>   	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env1, 1);
>>>   	ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env2, 1);
>>> -#ifdef CONFIG_SPL_BUILD
>>> -	dev = 0;
>>> -#endif
>>> -
>>>   	mmc = find_mmc_device(dev);
>>>   	errmsg = init_mmc_for_env(mmc);
>>> @@ -306,10 +295,6 @@ void env_relocate_spec(void)
>>>   	int dev = mmc_get_env_dev();
>>>   	const char *errmsg;
>>> -#ifdef CONFIG_SPL_BUILD
>>> -	dev = 0;
>>> -#endif
>>> -
>>>   	mmc = find_mmc_device(dev);
>>>   	errmsg = init_mmc_for_env(mmc);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] env_mmc: Allow SPL to use any MMC device to load/save the environment
  2017-02-01 10:26 [U-Boot] [PATCH] env_mmc: Allow SPL to use any MMC device to load/save the environment Jean-Jacques Hiblot
  2017-02-14 13:16 ` Jean-Jacques Hiblot
@ 2017-04-09  1:14 ` Tom Rini
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2017-04-09  1:14 UTC (permalink / raw)
  To: u-boot

On Wed, Feb 01, 2017 at 11:26:53AM +0100, Jean-Jacques Hiblot wrote:

> SPL has been restricted to use only dev 0 based on the assumption that only
> one MMC device is registered. This is not always the case and many
> platforms now register several devices as expected by the spl mmc boot code
> For those platform SPL_ENV_SUPPORT is broken if dev is forced to 0.
> 
> A word of warning: this commit may break SPL_ENV_SUPPORT on platforms that
> do not register the same MMC controllers in SPL and in u-boot (mostly iMX6
> based platforms). Fortunately none of those activate SPL_ENV_SUPPORT in
> their default configuration.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170408/4dc45fe1/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-09  1:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-01 10:26 [U-Boot] [PATCH] env_mmc: Allow SPL to use any MMC device to load/save the environment Jean-Jacques Hiblot
2017-02-14 13:16 ` Jean-Jacques Hiblot
2017-02-14 18:52   ` Tom Rini
2017-02-15  9:05     ` Jean-Jacques Hiblot
2017-04-07 12:02     ` Jean-Jacques Hiblot
2017-04-09  1:14 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox