mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* /dev/env0 not found
@ 2011-01-14 12:01 Nataraj S Narayan
  2011-01-14 13:26 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Nataraj S Narayan @ 2011-01-14 12:01 UTC (permalink / raw)
  To: barebox

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
9263-EK:/


regards

Nataraj

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: /dev/env0 not found
  2011-01-14 12:01 /dev/env0 not found Nataraj S Narayan
@ 2011-01-14 13:26 ` Sascha Hauer
  2011-01-14 15:25   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2011-01-14 13:26 UTC (permalink / raw)
  To: Nataraj S Narayan; +Cc: barebox

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: /dev/env0 not found
  2011-01-14 13:26 ` Sascha Hauer
@ 2011-01-14 15:25   ` Jean-Christophe PLAGNIOL-VILLARD
  2011-01-14 18:52     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-01-14 15:25 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 14:26 Fri 14 Jan     , Sascha Hauer wrote:
> 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.
unfortunatly no

:(

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: /dev/env0 not found
  2011-01-14 15:25   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-01-14 18:52     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2011-01-14 18:52 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Fri, Jan 14, 2011 at 04:25:38PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 14:26 Fri 14 Jan     , Sascha Hauer wrote:
> > 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.
> unfortunatly no

Maybe we should add a kconfig option for this. The current behaviour
seems rather random.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-14 18:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-14 12:01 /dev/env0 not found Nataraj S Narayan
2011-01-14 13:26 ` Sascha Hauer
2011-01-14 15:25   ` Jean-Christophe PLAGNIOL-VILLARD
2011-01-14 18:52     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox