From: Sascha Hauer <s.hauer@pengutronix.de>
To: Nataraj S Narayan <natarajsn@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: /dev/env0 not found
Date: Fri, 14 Jan 2011 14:26:45 +0100 [thread overview]
Message-ID: <20110114132644.GL24373@pengutronix.de> (raw)
In-Reply-To: <AANLkTimz8ffNYpkHYdKVwv4=khBn=JKMwjsRQB5DEK63@mail.gmail.com>
Hi Nataraj,
On Fri, Jan 14, 2011 at 12:01:25PM +0000, Nataraj S Narayan wrote:
> Hi
>
> How I come I don't have /dev/env0? I am on at91sam9263ek.
>
> 9263-EK:/ saveenv
> saving environment
> could not open /dev/env0: Read-only file system
>
> 9263-EK:/ ls -l /dev/env0
> ls: /dev/env0: No such file or directory
>
> 9263-EK:/ ls -l /dev/
> cr-------- 4294967295 zero
> crw------- 3785 defaultenv
> crw------- 4294967295 mem
> crw------- 67108864 ram0
> crw------- 268435456 nand0
> cr-------- 8388608 nand_oob0
> crw------- 32 phy0
> crw------- 3851423744 nor-352321538
^^^^^^^^^^
This should normally be nor0. The name comes from
info->cdev.name = asprintf("nor%d", dev->id);
in cfi_probe. dev->id is normally initialized to -1 in
arch/arm/boards/at91sam9263ek/init.c, then changed to 0 in
register_device:
if (new_device->id < 0) {
new_device->id = get_free_deviceid(new_device->name);
}
...
I have no idea why this does not work in your case, so it's maybe best
to add some printfs in the path I just described to see where dev->id is
actually changed to such a bogus value.
Note that on the at91sam9263ek the environment partition is added as
follows:
#if defined(CONFIG_DRIVER_CFI) || defined(CONFIG_DRIVER_CFI_OLD)
devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self");
devfs_add_partition("nor0", 0x40000, 0x20000, PARTITION_FIXED, "env0");
#elif defined(CONFIG_NAND_ATMEL)
devfs_add_partition("nand0", 0x00000, 0x80000, PARTITION_FIXED, "self_raw");
dev_add_bb_dev("self_raw", "self0");
devfs_add_partition("nand0", 0x40000, 0x40000, PARTITION_FIXED, "env_raw");
dev_add_bb_dev("env_raw", "env0");
#endif
This means that when both nand and nor flash is compiled in the
environment which be in nor flash. On i.MX we have a way to figure out
if barebox is started from nor or from nand and locate the environment
in the same device as barebox is started from. I don't know if that's
possible on the Atmel processors though.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-01-14 13:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-14 12:01 Nataraj S Narayan
2011-01-14 13:26 ` Sascha Hauer [this message]
2011-01-14 15:25 ` Jean-Christophe PLAGNIOL-VILLARD
2011-01-14 18:52 ` Sascha Hauer
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=20110114132644.GL24373@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=natarajsn@gmail.com \
/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