Skip to content
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

jeremyherbert
Copy link
Contributor

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
Copy link
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.

@jeremyherbert
Copy link
Contributor Author

Hi Michal,

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

@jeremyherbert
Copy link
Contributor Author

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
Copy link
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

@jeremyherbert
Copy link
Contributor Author

Commits squashed here.

Thanks,
Jeremy

@michalsimek
Copy link
Member

merged with small changes of commit message.

jacobmcnamee added a commit to jacobmcnamee/u-boot-xlnx that referenced this pull request Jan 20, 2017
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
Labels
None yet
Projects
None yet
2 participants