All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] FIT: workarounding wrong configuration name
@ 2015-05-04  7:53 yegorslists at googlemail.com
  2015-05-04  7:53 ` [U-Boot] [RFC] FIT: use default configuration, if given configuration is not found yegorslists at googlemail.com
  0 siblings, 1 reply; 7+ messages in thread
From: yegorslists at googlemail.com @ 2015-05-04  7:53 UTC (permalink / raw)
  To: u-boot

In our project we read device ID from EEPROM and then select an appropriate
configuration "bootm ${loadaddr}#conf${board_name}". If for some reason wrong
ID was written into EEPROM, then it is still important, that device can still
be booted with default configuration.

One can still put a big warning, saying, that provided configuration is missing
and that the system is using default one.

What do you think about this?

Regards,
Yegor

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

* [U-Boot] [RFC] FIT: use default configuration, if given configuration is  not found
  2015-05-04  7:53 [U-Boot] FIT: workarounding wrong configuration name yegorslists at googlemail.com
@ 2015-05-04  7:53 ` yegorslists at googlemail.com
  2015-05-04 18:16   ` Joe Hershberger
  0 siblings, 1 reply; 7+ messages in thread
From: yegorslists at googlemail.com @ 2015-05-04  7:53 UTC (permalink / raw)
  To: u-boot

From: Yegor Yefremov <yegorslists@googlemail.com>

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 common/image-fit.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/common/image-fit.c b/common/image-fit.c
index c61be65..b892d06 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1547,6 +1547,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
 		} else {
 			cfg_noffset = fit_conf_get_node(fit,
 							fit_uname_config);
+
+			if (cfg_noffset < 0) {
+				cfg_noffset = fit_conf_get_node(fit, NULL);
+			}
 		}
 		if (cfg_noffset < 0) {
 			puts("Could not find configuration node\n");
-- 
1.7.7

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

* [U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
  2015-05-04  7:53 ` [U-Boot] [RFC] FIT: use default configuration, if given configuration is not found yegorslists at googlemail.com
@ 2015-05-04 18:16   ` Joe Hershberger
  2015-05-12  6:43     ` Yegor Yefremov
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Hershberger @ 2015-05-04 18:16 UTC (permalink / raw)
  To: u-boot

Hi Yegor,

On Mon, May 4, 2015 at 2:53 AM,  <yegorslists@googlemail.com> wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  common/image-fit.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/common/image-fit.c b/common/image-fit.c
> index c61be65..b892d06 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -1547,6 +1547,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
>                 } else {
>                         cfg_noffset = fit_conf_get_node(fit,
>                                                         fit_uname_config);
> +
> +                       if (cfg_noffset < 0) {
> +                               cfg_noffset = fit_conf_get_node(fit, NULL);
> +                       }

It seems if you ask for a specific configuration that is not
available, you should get an error.

You can accomplish similar behavior you are implementing here by using
the shell to try the default if the specified one returns an error.

>                 }
>                 if (cfg_noffset < 0) {
>                         puts("Could not find configuration node\n");

Cheers,
-Joe

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

* [U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
  2015-05-04 18:16   ` Joe Hershberger
@ 2015-05-12  6:43     ` Yegor Yefremov
  2015-05-12 20:18       ` Joe Hershberger
  0 siblings, 1 reply; 7+ messages in thread
From: Yegor Yefremov @ 2015-05-12  6:43 UTC (permalink / raw)
  To: u-boot

Hi Joe,

On Mon, May 4, 2015 at 8:16 PM, Joe Hershberger
<joe.hershberger@gmail.com> wrote:
> Hi Yegor,
>
> On Mon, May 4, 2015 at 2:53 AM,  <yegorslists@googlemail.com> wrote:
>> From: Yegor Yefremov <yegorslists@googlemail.com>
>>
>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
>> ---
>>  common/image-fit.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/common/image-fit.c b/common/image-fit.c
>> index c61be65..b892d06 100644
>> --- a/common/image-fit.c
>> +++ b/common/image-fit.c
>> @@ -1547,6 +1547,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
>>                 } else {
>>                         cfg_noffset = fit_conf_get_node(fit,
>>                                                         fit_uname_config);
>> +
>> +                       if (cfg_noffset < 0) {
>> +                               cfg_noffset = fit_conf_get_node(fit, NULL);
>> +                       }
>
> It seems if you ask for a specific configuration that is not
> available, you should get an error.
>
> You can accomplish similar behavior you are implementing here by using
> the shell to try the default if the specified one returns an error.

Thanks. It is working:

bootm ${loadaddr}#conf${board_name}; if test $? -ne 0; then echo
"Using default FIT configuration"; bootm ${loadaddr}; fi;

Now I have another question, how can I split long line in uEnv.txt? Is
it possible at all?

Yegor

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

* [U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
  2015-05-12  6:43     ` Yegor Yefremov
@ 2015-05-12 20:18       ` Joe Hershberger
  2015-05-12 20:41         ` Yegor Yefremov
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Hershberger @ 2015-05-12 20:18 UTC (permalink / raw)
  To: u-boot

Hi Yegor,

On Tue, May 12, 2015 at 1:43 AM, Yegor Yefremov
<yegorslists@googlemail.com> wrote:
> Hi Joe,
>
> On Mon, May 4, 2015 at 8:16 PM, Joe Hershberger
> <joe.hershberger@gmail.com> wrote:
>> Hi Yegor,
>>
>> On Mon, May 4, 2015 at 2:53 AM,  <yegorslists@googlemail.com> wrote:
>>> From: Yegor Yefremov <yegorslists@googlemail.com>
>>>
>>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
>>> ---
>>>  common/image-fit.c |    4 ++++
>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/common/image-fit.c b/common/image-fit.c
>>> index c61be65..b892d06 100644
>>> --- a/common/image-fit.c
>>> +++ b/common/image-fit.c
>>> @@ -1547,6 +1547,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
>>>                 } else {
>>>                         cfg_noffset = fit_conf_get_node(fit,
>>>                                                         fit_uname_config);
>>> +
>>> +                       if (cfg_noffset < 0) {
>>> +                               cfg_noffset = fit_conf_get_node(fit, NULL);
>>> +                       }
>>
>> It seems if you ask for a specific configuration that is not
>> available, you should get an error.
>>
>> You can accomplish similar behavior you are implementing here by using
>> the shell to try the default if the specified one returns an error.
>
> Thanks. It is working:
>
> bootm ${loadaddr}#conf${board_name}; if test $? -ne 0; then echo
> "Using default FIT configuration"; bootm ${loadaddr}; fi;

Great!

> Now I have another question, how can I split long line in uEnv.txt? Is
> it possible at all?

I assume you are loading it and eventually calling env import on the memory?

Have you tried passing the -t switch to the env import command?

Or are you talking about a single variable value that is a long line?

-Joe

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

* [U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
  2015-05-12 20:18       ` Joe Hershberger
@ 2015-05-12 20:41         ` Yegor Yefremov
  2015-05-12 20:46           ` Joe Hershberger
  0 siblings, 1 reply; 7+ messages in thread
From: Yegor Yefremov @ 2015-05-12 20:41 UTC (permalink / raw)
  To: u-boot

Hi Joe,

On Tue, May 12, 2015 at 10:18 PM, Joe Hershberger
<joe.hershberger@gmail.com> wrote:
> Hi Yegor,
>
> On Tue, May 12, 2015 at 1:43 AM, Yegor Yefremov
> <yegorslists@googlemail.com> wrote:
>> Hi Joe,
>>
>> On Mon, May 4, 2015 at 8:16 PM, Joe Hershberger
>> <joe.hershberger@gmail.com> wrote:
>>> Hi Yegor,
>>>
>>> On Mon, May 4, 2015 at 2:53 AM,  <yegorslists@googlemail.com> wrote:
>>>> From: Yegor Yefremov <yegorslists@googlemail.com>
>>>>
>>>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
>>>> ---
>>>>  common/image-fit.c |    4 ++++
>>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/common/image-fit.c b/common/image-fit.c
>>>> index c61be65..b892d06 100644
>>>> --- a/common/image-fit.c
>>>> +++ b/common/image-fit.c
>>>> @@ -1547,6 +1547,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
>>>>                 } else {
>>>>                         cfg_noffset = fit_conf_get_node(fit,
>>>>                                                         fit_uname_config);
>>>> +
>>>> +                       if (cfg_noffset < 0) {
>>>> +                               cfg_noffset = fit_conf_get_node(fit, NULL);
>>>> +                       }
>>>
>>> It seems if you ask for a specific configuration that is not
>>> available, you should get an error.
>>>
>>> You can accomplish similar behavior you are implementing here by using
>>> the shell to try the default if the specified one returns an error.
>>
>> Thanks. It is working:
>>
>> bootm ${loadaddr}#conf${board_name}; if test $? -ne 0; then echo
>> "Using default FIT configuration"; bootm ${loadaddr}; fi;
>
> Great!
>
>> Now I have another question, how can I split long line in uEnv.txt? Is
>> it possible at all?
>
> I assume you are loading it and eventually calling env import on the memory?
>
> Have you tried passing the -t switch to the env import command?
>
> Or are you talking about a single variable value that is a long line?

Yes, I'm talking about a single variable with very long value.

Yegor

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

* [U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
  2015-05-12 20:41         ` Yegor Yefremov
@ 2015-05-12 20:46           ` Joe Hershberger
  0 siblings, 0 replies; 7+ messages in thread
From: Joe Hershberger @ 2015-05-12 20:46 UTC (permalink / raw)
  To: u-boot

Hi Yegor,

On Tue, May 12, 2015 at 3:41 PM, Yegor Yefremov
<yegorslists@googlemail.com> wrote:
> Hi Joe,
>
> On Tue, May 12, 2015 at 10:18 PM, Joe Hershberger
> <joe.hershberger@gmail.com> wrote:
>> Hi Yegor,
>>
>> On Tue, May 12, 2015 at 1:43 AM, Yegor Yefremov
>> <yegorslists@googlemail.com> wrote:
>>> Hi Joe,
>>>
>>> On Mon, May 4, 2015 at 8:16 PM, Joe Hershberger
>>> <joe.hershberger@gmail.com> wrote:
>>>> Hi Yegor,
>>>>
>>>> On Mon, May 4, 2015 at 2:53 AM,  <yegorslists@googlemail.com> wrote:
>>>>> From: Yegor Yefremov <yegorslists@googlemail.com>
>>>>>
>>>>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
>>>>> ---
>>>>>  common/image-fit.c |    4 ++++
>>>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>>>
>>>>> diff --git a/common/image-fit.c b/common/image-fit.c
>>>>> index c61be65..b892d06 100644
>>>>> --- a/common/image-fit.c
>>>>> +++ b/common/image-fit.c
>>>>> @@ -1547,6 +1547,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
>>>>>                 } else {
>>>>>                         cfg_noffset = fit_conf_get_node(fit,
>>>>>                                                         fit_uname_config);
>>>>> +
>>>>> +                       if (cfg_noffset < 0) {
>>>>> +                               cfg_noffset = fit_conf_get_node(fit, NULL);
>>>>> +                       }
>>>>
>>>> It seems if you ask for a specific configuration that is not
>>>> available, you should get an error.
>>>>
>>>> You can accomplish similar behavior you are implementing here by using
>>>> the shell to try the default if the specified one returns an error.
>>>
>>> Thanks. It is working:
>>>
>>> bootm ${loadaddr}#conf${board_name}; if test $? -ne 0; then echo
>>> "Using default FIT configuration"; bootm ${loadaddr}; fi;
>>
>> Great!
>>
>>> Now I have another question, how can I split long line in uEnv.txt? Is
>>> it possible at all?
>>
>> I assume you are loading it and eventually calling env import on the memory?
>>
>> Have you tried passing the -t switch to the env import command?
>>
>> Or are you talking about a single variable value that is a long line?
>
> Yes, I'm talking about a single variable with very long value.

I think we would need to patch the env import to handle escaping
newlines to do something like this. Then you could end a line with \
and it would still be part of the value of the previous variable.

I'm not sure of a way as it works now.

-Joe

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

end of thread, other threads:[~2015-05-12 20:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04  7:53 [U-Boot] FIT: workarounding wrong configuration name yegorslists at googlemail.com
2015-05-04  7:53 ` [U-Boot] [RFC] FIT: use default configuration, if given configuration is not found yegorslists at googlemail.com
2015-05-04 18:16   ` Joe Hershberger
2015-05-12  6:43     ` Yegor Yefremov
2015-05-12 20:18       ` Joe Hershberger
2015-05-12 20:41         ` Yegor Yefremov
2015-05-12 20:46           ` Joe Hershberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.