From: Brendan Simon (eTRIX) <brendan.simon@etrix.com.au>
To: u-boot@lists.denx.de
Subject: [U-Boot] fw_env.config settings for Digilent ZedBoard (Zynq 7020 Soc)
Date: Mon, 7 Dec 2015 22:38:53 +1100 [thread overview]
Message-ID: <56656FCD.2030804@etrix.com.au> (raw)
In-Reply-To: <20151207103555.67b10c64@crub>
Hi. see inline comments below ...
On 7/12/2015 8:35 PM, Anatolij Gustschin wrote:
> On Sun, 6 Dec 2015 12:01:08 +1100
> "Brendan Simon (eTRIX)" <brendan.simon@etrix.com.au> wrote:
>
>> Here is info from /proc/mtd and my /etc/fw_env.config.
>>
>> root at bjs:~# cat
>> /proc/mtd
>>
>> dev: size erasesize name
>> mtd0: 00500000 00010000 "boot"
>> mtd1: 00020000 00010000 "bootenv"
>> mtd2: 00020000 00010000 "config"
>> mtd3: 00a80000 00010000 "image"
>> mtd4: 01040000 00010000 "spare"
>>
>> root at bjs:~# cat
>> /etc/fw_env.config
>>
>> # Configuration file for fw_(printenv/setenv) utility.
>> # Up to two entries are valid, in this case the redundant
>> # environment sector is assumed present.
>> # MTD device name Device offset Env. size Flash sector size
>> # /dev/mtd1 0x0000 0x20000 0x40000
>> # /dev/mtd1 0x0000 0x20000 0x20000
>> # /dev/mtd1 0x0000 0x20000 0x10000
>> # /dev/mtd2 0x0000 0x20000 0x40000
>> # /dev/mtd2 0x0000 0x20000 0x20000
>> /dev/mtd2 0x0000 0x20000 0x10000
>>
>> Does anyone have any insight into what the correct fw_env.config
>> settings should be from the above info?
> Using /dev/mtd2 in /etc/fw_env.config might be wrong. First, you need to figure
> out which mtd partition contains the sectors with U-Boot environment variables.
> According to /proc/mtd info it could be the mtd1, if the mtd partitions layout
> under linux is correct. To check it, just run
>
> dd if=/dev/mtd1 | hexdump -C
>
> If the dumped data looks like environment variables, e.g.
>
> 00000000 a5 72 49 1b 01 61 64 64 63 6f 6e 73 3d 73 65 74 |.rI..addcons=set|
> 00000010 65 6e 76 20 62 6f 6f 74 61 72 67 73 20 24 7b 62 |env bootargs ${b|
> 00000020 6f 6f 74 61 72 67 73 7d 20 63 6f 6e 73 6f 6c 65 |ootargs} console|
> 00000030 3d 24 7b 63 6f 6e 73 6f 6c 65 7d 2c 24 7b 62 61 |=${console},${ba|
> ...
>
> then the mtd1 device is correct. Use it in fw_env.config.
> To determine other parameters for fw_env.config you need to check the
> used environment configuration in the U-Boot source, in the board's config
> file (include/configs/zyng_zed.h, include/configs/zynq-common.h). Search
> for CONFIG_ENV_SIZE, CONFIG_ENV_SECT_SIZE and CONFIG_ENV_OFFSET macros.
So u-boot sources tell me the ENV_OFFSET is at 0xE0000 and the ENV_SIZE
is (128 << 10) = 0x20000
I tried dd with "bs=1 skip=917504" and could not find anything in mtd1
or mtd2 ...
I finally tried mtd0 and found env vars :)
I updated /etc/fw_env.config to the following and now fw_printenv works
and no crc errors are reported. Yay :)
/dev/mtd0 0xE0000 0x20000 0x20000
Is it normal for the environment to not be@offset 0x0 and not be in
it's own dedicated mtd partition?
>> How can I find out the correct settings. Is there a command in u-boot
>> itself which will report the correct information?
> for ZedBoard, you probably can not. It depends on the U-Boot configuration.
> If the "mtd" command support is compiled in and the "mtdparts" environment
> variable is set properly, then it could be possible to output some
> info.
"mtd" command is not compiled in. Might try a custom build of u-boot.
Thanks,
Brendan.
next prev parent reply other threads:[~2015-12-07 11:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-06 1:01 [U-Boot] fw_env.config settings for Digilent ZedBoard (Zynq 7020 Soc) Brendan Simon
2015-12-07 9:35 ` Anatolij Gustschin
2015-12-07 11:38 ` Brendan Simon [this message]
2015-12-07 12:56 ` Anatolij Gustschin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56656FCD.2030804@etrix.com.au \
--to=brendan.simon@etrix.com.au \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox