New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load environment variables from uEnv.txt at preboot #24

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@jeremyherbert
Contributor

jeremyherbert commented Mar 10, 2015

Hi,

When using a uEnv.txt file, the environment variables are loaded too late to influence some of the behaviour of u-boot. In my case, I wanted to be able to set "bootdelay" using uEnv.txt rather than recompiling u-boot. This pull request fixes that.

I've tested this on a Digilent Zybo, and it also does not cause problems if there is no uEnv.txt file present.

Questions, comments and suggestions are welcome.

Thanks,
Jeremy

@michalsimek

This comment has been minimized.

Show comment
Hide comment
@michalsimek

michalsimek Mar 13, 2015

Member

Hi,
idea to use preboot to try to load variable from SD card is good but implementation is not the best.

When I apply this patch everybody will see message about loading file from SD which ends up in questions why it is failing.
Board: Xilinx Zynq
Net: Gem.e000b000
reading uEnv.txt
** Unable to read file uEnv.txt **
Hit any key to stop autoboot: 0
zynq-uboot>

Also message on systems without MMC looks weird
** Bad device mmc 0 **
Hit any key to stop autoboot: 0

Please check if there is better way how to do it but I can't apply this patch with the current implementation.

Member

michalsimek commented Mar 13, 2015

Hi,
idea to use preboot to try to load variable from SD card is good but implementation is not the best.

When I apply this patch everybody will see message about loading file from SD which ends up in questions why it is failing.
Board: Xilinx Zynq
Net: Gem.e000b000
reading uEnv.txt
** Unable to read file uEnv.txt **
Hit any key to stop autoboot: 0
zynq-uboot>

Also message on systems without MMC looks weird
** Bad device mmc 0 **
Hit any key to stop autoboot: 0

Please check if there is better way how to do it but I can't apply this patch with the current implementation.

@jeremyherbert

This comment has been minimized.

Show comment
Hide comment
@jeremyherbert

jeremyherbert Mar 13, 2015

Contributor

Hi Michal,

Sorry, didn't think about that. Will look for a fix.

Contributor

jeremyherbert commented Mar 13, 2015

Hi Michal,

Sorry, didn't think about that. Will look for a fix.

@jeremyherbert

This comment has been minimized.

Show comment
Hide comment
@jeremyherbert

jeremyherbert Mar 13, 2015

Contributor

Hi Michal,

I fixed up the error showing up, but this problem is not entirely my doing. If you boot without an uEnv.txt with the vanilla xilinx master version, you will still get uEnv.txt errors:

...
In:    serial
Out:   serial
Err:   serial
Board:.Xilinx Zynq
Net:   Gem.e000b000
Hit any key to stop autoboot:  0 
Device: zynq_sdhci
Manufacturer ID: 3
OEM: 5344
Name: SU08G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
reading uEnv.txt
** Unable to read file uEnv.txt **
Copying Linux from SD to RAM...
reading uImage
3453832 bytes read in 304 ms (10.8 MiB/s)
...

This is fairly clear if you take a look at the surrounding code in zynq-common.h. As I now recall, this is why I did not fix the error, as I thought it was present in the other case on purpose, and I wanted to be consistent with the code that was already there.

I'd be happy to fix this error message too, but I think that should probably come under a different pull request as it is really a different problem. What do you think?

Thanks,
Jeremy

Contributor

jeremyherbert commented Mar 13, 2015

Hi Michal,

I fixed up the error showing up, but this problem is not entirely my doing. If you boot without an uEnv.txt with the vanilla xilinx master version, you will still get uEnv.txt errors:

...
In:    serial
Out:   serial
Err:   serial
Board:.Xilinx Zynq
Net:   Gem.e000b000
Hit any key to stop autoboot:  0 
Device: zynq_sdhci
Manufacturer ID: 3
OEM: 5344
Name: SU08G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
reading uEnv.txt
** Unable to read file uEnv.txt **
Copying Linux from SD to RAM...
reading uImage
3453832 bytes read in 304 ms (10.8 MiB/s)
...

This is fairly clear if you take a look at the surrounding code in zynq-common.h. As I now recall, this is why I did not fix the error, as I thought it was present in the other case on purpose, and I wanted to be consistent with the code that was already there.

I'd be happy to fix this error message too, but I think that should probably come under a different pull request as it is really a different problem. What do you think?

Thanks,
Jeremy

@michalsimek

This comment has been minimized.

Show comment
Hide comment
@michalsimek

michalsimek Mar 19, 2015

Member

ok - this is better now. Can you please squash that two patches together and send it to git@xilinx.com
with proper description? Or of course add it here - but really I want to have just one patch not two.
Thanks,
Michal

Member

michalsimek commented Mar 19, 2015

ok - this is better now. Can you please squash that two patches together and send it to git@xilinx.com
with proper description? Or of course add it here - but really I want to have just one patch not two.
Thanks,
Michal

@jeremyherbert

This comment has been minimized.

Show comment
Hide comment
@jeremyherbert

jeremyherbert Mar 19, 2015

Contributor

Commits squashed here.

Thanks,
Jeremy

Contributor

jeremyherbert commented Mar 19, 2015

Commits squashed here.

Thanks,
Jeremy

@michalsimek

This comment has been minimized.

Show comment
Hide comment
@michalsimek

michalsimek Mar 19, 2015

Member

merged with small changes of commit message.

Member

michalsimek commented Mar 19, 2015

merged with small changes of commit message.

jacobmcnamee added a commit to jacobmcnamee/u-boot-xlnx that referenced this pull request Jan 20, 2017

Merge pull request #24 from jacobmcnamee/tpl_ram
TPL: Copy data from flash to RAM before using
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment