FIT: workarounding wrong configuration name
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
RFC 1/1 FIT: use default configuration, if given configuration is not found
From: Yegor Yefremov <[email protected]>
--- common/image-fit.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
common/image-fit.c +4 -0
@@ -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" );
Signature · 1 line
1.7.7
[U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
Hi Yegor,
Quoted 12 lines · On Mon, May 4, 2015 at 2:53 AM, <[email protected]> wrote:
From: Yegor Yefremov <[email protected]>
Signed-off-by Yegor Yefremov <[email protected]>--- common/image-fit.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)common/image-fit.c +0
-0
common/image-fit.c int fit_image_load(bootm_headers_t *images, ulong addr, · line 1553
Quoted 7 lines
common/image-fit.c +4
-0@@ -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.
common/image-fit.c int fit_image_load(bootm_headers_t *images, ulong addr, · line 1556
Quoted 3 lines
common/image-fit.c +0
-0}if (cfg_noffset <0 ) {puts ("Could not find configuration node\n" );
Cheers,
-Joe
[U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
Hi Joe,
Quoted 26 lines · Joe Hershberger
Hi Yegor,
Quoted 12 lines · On Mon, May 4, 2015 at 2:53 AM, <[email protected]> wrote:
From: Yegor Yefremov <[email protected]>
Signed-off-by Yegor Yefremov <[email protected]>--- common/image-fit.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)common/image-fit.c +0
-0common/image-fit.c int fit_image_load(bootm_headers_t *images, ulong addr, · line 1553
Quoted 7 lines
common/image-fit.c +4
-0@@ -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.
Quoted 2 lines
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
[U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
Hi Yegor,
Quoted 30 lines · Yegor Yefremov
Hi Joe,
Quoted 26 lines · Joe Hershberger
Hi Yegor,
Quoted 12 lines · On Mon, May 4, 2015 at 2:53 AM, <[email protected]> wrote:
From: Yegor Yefremov <[email protected]>
Signed-off-by Yegor Yefremov <[email protected]>--- common/image-fit.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)common/image-fit.c +0
-0common/image-fit.c int fit_image_load(bootm_headers_t *images, ulong addr, · line 1553
Quoted 7 lines
common/image-fit.c +4
-0@@ -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.
Quoted 7 lines
Quoted 2 lines
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!
Quoted 2 lines
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
[U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
Hi Joe,
Quoted 44 lines · Joe Hershberger
Hi Yegor,
Quoted 30 lines · Yegor Yefremov
Hi Joe,
Quoted 26 lines · Joe Hershberger
Hi Yegor,
Quoted 12 lines · On Mon, May 4, 2015 at 2:53 AM, <[email protected]> wrote:
From: Yegor Yefremov <[email protected]>
Signed-off-by Yegor Yefremov <[email protected]>--- common/image-fit.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)common/image-fit.c +0
-0common/image-fit.c int fit_image_load(bootm_headers_t *images, ulong addr, · line 1553
Quoted 7 lines
common/image-fit.c +4
-0@@ -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.
Quoted 7 lines
Quoted 2 lines
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!
Quoted 8 lines
Quoted 2 lines
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
[U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
Hi Yegor,
Quoted 51 lines · Yegor Yefremov
Hi Joe,
Quoted 47 lines · Joe Hershberger
Hi Yegor,
Quoted 30 lines · Yegor Yefremov
Hi Joe,
Quoted 26 lines · Joe Hershberger
Hi Yegor,
Quoted 12 lines · On Mon, May 4, 2015 at 2:53 AM, <[email protected]> wrote:
From: Yegor Yefremov <[email protected]>
Signed-off-by Yegor Yefremov <[email protected]>--- common/image-fit.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)common/image-fit.c +0
-0common/image-fit.c int fit_image_load(bootm_headers_t *images, ulong addr, · line 1553
Quoted 7 lines
common/image-fit.c +4
-0@@ -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.
Quoted 7 lines
Quoted 2 lines
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!
Quoted 2 lines
Now I have another question, how can I split long line in uEnv.txt? Is it possible at all?
Quoted 7 lines
Quoted 5 lines
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