public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] cannot mount effs2 filesystem at boot
@ 2004-07-29 11:04 brix82
  2004-08-02 11:19 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: brix82 @ 2004-07-29 11:04 UTC (permalink / raw)
  To: ecos-discuss

Hi, i'm writing an application for the xscale pxa architecture. It's a sort of
shell which runs on eCos - it is linked against the eCos build. On the xscale
board there is a flash memory where i used to store a RomFS image, and it worked
well with my application; ecos successfully mounted it under the root directory.
Now i'm trying to use jffs2 to implement a 'create' command in my shell, but i
don't find how to mount the filesystem under the root directory at boot. I tried
to modify packages/fs/jffs2/v2_0/src/fs-ecos.c adding this:

#define FS_BASE_ADDRESS 0x50300000 // address of the image in flash

  MTAB_ENTRY(	jffs2_mte,	// structure name
 		"/",		  // mount point
 		"jffs2",	// Filesystem type
 		"/dev/flash", // hardware device
    (CYG_ADDRWORD) FS_BASE_ADDRESS	// Address in ROM
   );

It compiles, but doesn't work. I then compiled and ran the jffs2 test program
and this is the output:

RedBoot> go
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x6972
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x7542
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0x7265
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0x002c
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x2800
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x0001
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0x7465
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x6f63
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x676e
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x2814
instead
<5>Further such events for this erase block will not be printed
<4>Empty flash at 0x0000d1e0 ends at 0x0000d1e4
<4>Empty flash at 0x0001598c ends at 0x00015990
<4>Empty flash at 0x00018cf4 ends at 0x00018cf8
<4>Empty flash at 0x00019cb0 ends at 0x00019cb4
<4>Empty flash at 0x0001ac80 ends at 0x0001ac84
<4>Empty flash at 0x0001b184 ends at 0x0001b188
<4>Empty flash at 0x00039928 ends at 0x0003992c
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040004: 0x0001
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040008: 0x5454
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0004000c: 0x4142
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040010: 0x454d
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040014: 0x444f
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040018: 0x0100
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0004001c: 0x1000
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040020: 0x5054
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040024: 0x4441
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040028: 0x5145
instead
<5>Further such events for this erase block will not be printed
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080000: 0x0400
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080004: 0x4929
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080008: 0x6707
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0008000c: 0x6f4c
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080010: 0x0001
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080014: 0x2949
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080018: 0x0900
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0008001c: 0x4f74
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080020: 0x6365
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080024: 0x1500
instead
<5>Further such events for this erase block will not be printed
<4>Empty flash at 0x0008c4c4 ends at 0x0008c4c8
<4>Empty flash at 0x0008c4cc ends at 0x0008c4d0
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0000: 0x0001
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0004: 0x2b00
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0008: 0x616a
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c000c: 0x752f
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0010: 0x2f6c
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0014: 0x6b6e
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0018: 0x694c
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c001c: 0x4c3b
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0020: 0x6176
instead
<5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0024: 0x6e61
instead
<5>Further such events for this erase block will not be printed
<5>Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
<5>empty_blocks 0, bad_blocks 0, c->nr_blocks 4
<FAIL>: mount() returned -1 I/O error

It seems is looks for a filesystem in the wrong position. Maybe i have to use
another device? I tried /dev/mtd but with no success.


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] cannot mount effs2 filesystem at boot
  2004-07-29 11:04 [ECOS] cannot mount effs2 filesystem at boot brix82
@ 2004-08-02 11:19 ` Andrew Lunn
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2004-08-02 11:19 UTC (permalink / raw)
  To: brix82; +Cc: ecos-discuss

On Thu, Jul 29, 2004 at 12:12:24PM +0200, brix82@libero.it wrote:
> Hi, i'm writing an application for the xscale pxa architecture. It's a sort of
> shell which runs on eCos - it is linked against the eCos build. On the xscale
> board there is a flash memory where i used to store a RomFS image, and it worked
> well with my application; ecos successfully mounted it under the root directory.
> Now i'm trying to use jffs2 to implement a 'create' command in my shell, but i
> don't find how to mount the filesystem under the root directory at boot. I tried
> to modify packages/fs/jffs2/v2_0/src/fs-ecos.c adding this:
> 
> #define FS_BASE_ADDRESS 0x50300000 // address of the image in flash
> 
>   MTAB_ENTRY(	jffs2_mte,	// structure name
>  		"/",		  // mount point
>  		"jffs2",	// Filesystem type
>  		"/dev/flash", // hardware device
>     (CYG_ADDRWORD) FS_BASE_ADDRESS	// Address in ROM
>    );

Take a look at fs/jffs2/current/tests/fileio1.c. This shows you how to
mount the fileystem. You don't need to give the address of the
image. That is in the CDL configuration of the flash io block driver
which i assume you have configured appropriately.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] cannot mount effs2 filesystem at boot
  2004-08-06 12:20 ` Andrew Lunn
@ 2004-08-07 11:10   ` Marco Bressan
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Bressan @ 2004-08-07 11:10 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Andrew Lunn wrote:

>On Fri, Aug 06, 2004 at 02:07:24PM +0200, brix82@libero.it wrote:
>  
>
>>---------- Initial Header -----------
>>
>>From      : ecos-discuss-owner@ecos.sourceware.org
>>To          : "brix82@libero.it" brix82@libero.it
>>Cc          : "ecos-discuss" ecos-discuss@sources.redhat.com
>>Date      : Mon, 2 Aug 2004 13:19:35 +0200
>>Subject : Re: [ECOS] cannot mount effs2 filesystem at boot
>>
>>    
>>
>>>On Thu, Jul 29, 2004 at 12:12:24PM +0200, brix82@libero.it wrote:
>>>      
>>>
>>>>Hi, i'm writing an application for the xscale pxa architecture. It's a sort of
>>>>shell which runs on eCos - it is linked against the eCos build. On the xscale
>>>>board there is a flash memory where i used to store a RomFS image, and it worked
>>>>well with my application; ecos successfully mounted it under the root directory.
>>>>Now i'm trying to use jffs2 to implement a 'create' command in my shell, but i
>>>>don't find how to mount the filesystem under the root directory at boot. I tried
>>>>to modify packages/fs/jffs2/v2_0/src/fs-ecos.c adding this:
>>>>
>>>>#define FS_BASE_ADDRESS 0x50300000 // address of the image in flash
>>>>
>>>>  MTAB_ENTRY(	jffs2_mte,	// structure name
>>>> 		"/",		  // mount point
>>>> 		"jffs2",	// Filesystem type
>>>> 		"/dev/flash", // hardware device
>>>>    (CYG_ADDRWORD) FS_BASE_ADDRESS	// Address in ROM
>>>>   );
>>>>        
>>>>
>>>Take a look at fs/jffs2/current/tests/fileio1.c. This shows you how to
>>>mount the fileystem. You don't need to give the address of the
>>>image. That is in the CDL configuration of the flash io block driver
>>>which i assume you have configured appropriately.
>>>
>>>        Andrew
>>>      
>>>
>>Thanks for your help, i didn't see this option. I have configured the flash io
>>block driver but the problem still remains. Look at this piece of my
>>configuration file:
>>
>>cdl_component CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1 {
>>    # Flavor: data
>>    user_value "\"/dev/flash1\""
>>    # value_source user
>>    # Default value: "\"/dev/flash1\""
>>};
>>
>>cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
>>    # Flavor: data
>>    user_value 0x50300000
>>    # value_source user
>>    # Default value: 0x00100000
>>};
>>    
>>
>
>Read the "description" for this option:
>
>cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
>	display         "Start offset from flash base"
>	flavor          data
>	default_value   0x100000
>	description     "
>		This gives the offset from the base of flash which this
>		block device corresponds to."
>	}
>
>I suppose you could have a flash which is 1283Mbytes big, but more
>likely you have this wrong!
>
>        Andrew
>
>  
>
The 0x50000000 address is a virtual address mapped to the physical base 
address of the flash memory. Similarly, 0x60000000 is mapped to the SRAM 
bank and 0x70000000 to the leds (to get a fantastic supercar effect!).
As you said, i need the offset from the base, not the address of the 
base; so i should use "0x00300000".
Thanks a lot for your help (i feel a bit stupid and lamer)

    Marco

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] cannot mount effs2 filesystem at boot
  2004-08-06 12:07 brix82
@ 2004-08-06 12:20 ` Andrew Lunn
  2004-08-07 11:10   ` Marco Bressan
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2004-08-06 12:20 UTC (permalink / raw)
  To: brix82; +Cc: andrew, ecos-discuss

On Fri, Aug 06, 2004 at 02:07:24PM +0200, brix82@libero.it wrote:
> ---------- Initial Header -----------
> 
> >From      : ecos-discuss-owner@ecos.sourceware.org
> To          : "brix82@libero.it" brix82@libero.it
> Cc          : "ecos-discuss" ecos-discuss@sources.redhat.com
> Date      : Mon, 2 Aug 2004 13:19:35 +0200
> Subject : Re: [ECOS] cannot mount effs2 filesystem at boot
> 
> > On Thu, Jul 29, 2004 at 12:12:24PM +0200, brix82@libero.it wrote:
> > > Hi, i'm writing an application for the xscale pxa architecture. It's a sort of
> > > shell which runs on eCos - it is linked against the eCos build. On the xscale
> > > board there is a flash memory where i used to store a RomFS image, and it worked
> > > well with my application; ecos successfully mounted it under the root directory.
> > > Now i'm trying to use jffs2 to implement a 'create' command in my shell, but i
> > > don't find how to mount the filesystem under the root directory at boot. I tried
> > > to modify packages/fs/jffs2/v2_0/src/fs-ecos.c adding this:
> > >
> > > #define FS_BASE_ADDRESS 0x50300000 // address of the image in flash
> > >
> > >   MTAB_ENTRY(	jffs2_mte,	// structure name
> > >  		"/",		  // mount point
> > >  		"jffs2",	// Filesystem type
> > >  		"/dev/flash", // hardware device
> > >     (CYG_ADDRWORD) FS_BASE_ADDRESS	// Address in ROM
> > >    );
> >
> > Take a look at fs/jffs2/current/tests/fileio1.c. This shows you how to
> > mount the fileystem. You don't need to give the address of the
> > image. That is in the CDL configuration of the flash io block driver
> > which i assume you have configured appropriately.
> >
> >         Andrew
> 
> Thanks for your help, i didn't see this option. I have configured the flash io
> block driver but the problem still remains. Look at this piece of my
> configuration file:
> 
> cdl_component CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1 {
>     # Flavor: data
>     user_value "\"/dev/flash1\""
>     # value_source user
>     # Default value: "\"/dev/flash1\""
> };
> 
> cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
>     # Flavor: data
>     user_value 0x50300000
>     # value_source user
>     # Default value: 0x00100000
> };

Read the "description" for this option:

cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
	display         "Start offset from flash base"
	flavor          data
	default_value   0x100000
	description     "
		This gives the offset from the base of flash which this
		block device corresponds to."
	}

I suppose you could have a flash which is 1283Mbytes big, but more
likely you have this wrong!

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] cannot mount effs2 filesystem at boot
@ 2004-08-06 12:07 brix82
  2004-08-06 12:20 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: brix82 @ 2004-08-06 12:07 UTC (permalink / raw)
  To: andrew; +Cc: ecos-discuss

---------- Initial Header -----------

From      : ecos-discuss-owner@ecos.sourceware.org
To          : "brix82@libero.it" brix82@libero.it
Cc          : "ecos-discuss" ecos-discuss@sources.redhat.com
Date      : Mon, 2 Aug 2004 13:19:35 +0200
Subject : Re: [ECOS] cannot mount effs2 filesystem at boot

> On Thu, Jul 29, 2004 at 12:12:24PM +0200, brix82@libero.it wrote:
> > Hi, i'm writing an application for the xscale pxa architecture. It's a sort of
> > shell which runs on eCos - it is linked against the eCos build. On the xscale
> > board there is a flash memory where i used to store a RomFS image, and it worked
> > well with my application; ecos successfully mounted it under the root directory.
> > Now i'm trying to use jffs2 to implement a 'create' command in my shell, but i
> > don't find how to mount the filesystem under the root directory at boot. I tried
> > to modify packages/fs/jffs2/v2_0/src/fs-ecos.c adding this:
> >
> > #define FS_BASE_ADDRESS 0x50300000 // address of the image in flash
> >
> >   MTAB_ENTRY(	jffs2_mte,	// structure name
> >  		"/",		  // mount point
> >  		"jffs2",	// Filesystem type
> >  		"/dev/flash", // hardware device
> >     (CYG_ADDRWORD) FS_BASE_ADDRESS	// Address in ROM
> >    );
>
> Take a look at fs/jffs2/current/tests/fileio1.c. This shows you how to
> mount the fileystem. You don't need to give the address of the
> image. That is in the CDL configuration of the flash io block driver
> which i assume you have configured appropriately.
>
>         Andrew

Thanks for your help, i didn't see this option. I have configured the flash io
block driver but the problem still remains. Look at this piece of my
configuration file:

cdl_component CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1 {
    # Flavor: data
    user_value "\"/dev/flash1\""
    # value_source user
    # Default value: "\"/dev/flash1\""
};

cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
    # Flavor: data
    user_value 0x50300000
    # value_source user
    # Default value: 0x00100000
};

cdl_option CYGNUM_IO_FLASH_BLOCK_LENGTH_1 {
    # Flavor: data
    user_value 0x00080000
    # value_source user
    # Default value: 0x00100000
};

It seems to be ok. I recompiled the libraries and the tests, but both fileio and
romfileio look at the beginning of the flash memory:

  RedBoot> go
  arenasize 66804088, freeblocks 1, totalallocated 528, totalfree 66803540,
maxfree 66803540
  <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000:
0x1977 instead
  ...

I don't understand why the configuration doesn't affect the test program (if
this is the case).
Thanks in advance,

   Marco Bressan


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2004-08-07 11:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-29 11:04 [ECOS] cannot mount effs2 filesystem at boot brix82
2004-08-02 11:19 ` Andrew Lunn
2004-08-06 12:07 brix82
2004-08-06 12:20 ` Andrew Lunn
2004-08-07 11:10   ` Marco Bressan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).