From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 26.mail-out.ovh.net ([91.121.27.225]) by canuck.infradead.org with smtp (Exim 4.72 #1 (Red Hat Linux)) id 1PdlXe-00019Y-9b for barebox@lists.infradead.org; Fri, 14 Jan 2011 15:26:21 +0000 Date: Fri, 14 Jan 2011 16:25:38 +0100 From: Jean-Christophe PLAGNIOL-VILLARD Message-ID: <20110114152538.GA27519@game.jcrosoft.org> References: <20110114132644.GL24373@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110114132644.GL24373@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: /dev/env0 not found To: Sascha Hauer Cc: barebox@lists.infradead.org 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